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}
An exception for terminatinating execution or to throw for unit testing.
testZeroIndentationThrowsException()
@expectedException \InvalidArgumentException @expectedExceptionMessage The indentation must be greate...
Definition: YamlTest.php:30
testNegativeIndentationThrowsException()
@expectedException \InvalidArgumentException @expectedExceptionMessage The indentation must be greate...
Definition: YamlTest.php:39
Yaml offers convenience methods to load and dump YAML.
Definition: Yaml.php:22
static parse($input, $flags=0)
Parses YAML into a PHP value.
Definition: Yaml.php:48
static dump($input, $inline=2, $indent=4, $flags=0)
Dumps a PHP value to a YAML string.
Definition: Yaml.php:94