public function DumperTest::testSpecifications in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/Yaml/Tests/DumperTest.php \Symfony\Component\Yaml\Tests\DumperTest::testSpecifications()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ Yaml/ Tests/ DumperTest.php, line 79
Class
Namespace
Symfony\Component\Yaml\TestsCode
public function testSpecifications() {
$files = $this->parser
->parse(file_get_contents($this->path . '/index.yml'));
foreach ($files as $file) {
$yamls = file_get_contents($this->path . '/' . $file . '.yml');
// split YAMLs documents
foreach (preg_split('/^---( %YAML\\:1\\.0)?/m', $yamls) as $yaml) {
if (!$yaml) {
continue;
}
$test = $this->parser
->parse($yaml);
if (isset($test['dump_skip']) && $test['dump_skip']) {
continue;
}
elseif (isset($test['todo']) && $test['todo']) {
// TODO
}
else {
eval('$expected = ' . trim($test['php']) . ';');
$this
->assertSame($expected, $this->parser
->parse($this->dumper
->dump($expected, 10)), $test['test']);
}
}
}
}