4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Yaml\Tests
;
14 use Symfony\Component\Yaml\Yaml
;
16 class YamlTest
extends \PHPUnit_Framework_TestCase
18 public function testParseAndDump()
20 $data = array('lorem' => 'ipsum', 'dolor' => 'sit');
21 $yml = Yaml
::dump($data);
22 $parsed = Yaml
::parse($yml);
23 $this->assertEquals($data, $parsed);
25 $filename = __DIR__
.'/Fixtures/index.yml';
26 $contents = file_get_contents($filename);
27 $parsedByFilename = Yaml
::parse($filename);
28 $parsedByContents = Yaml
::parse($contents);
29 $this->assertEquals($parsedByFilename, $parsedByContents);