ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
YamlTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
13 
15 
17 {
18  public function testParseAndDump()
19  {
20  $data = array('lorem' => 'ipsum', 'dolor' => 'sit');
21  $yml = Yaml::dump($data);
22  $parsed = Yaml::parse($yml);
23  $this->assertEquals($data, $parsed);
24  }
25 
31  {
32  Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, 0);
33  }
34 
40  {
41  Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, -4);
42  }
43 }
static dump($input, $inline=2, $indent=4, $flags=0)
Dumps a PHP value to a YAML string.
Definition: Yaml.php:94
testNegativeIndentationThrowsException()
The indentation must be greater than zero
Definition: YamlTest.php:39
static parse($input, $flags=0)
Parses YAML into a PHP value.
Definition: Yaml.php:48
Create styles array
The data for the language used.
testZeroIndentationThrowsException()
The indentation must be greater than zero
Definition: YamlTest.php:30