public function DumperTest::testSpecifications in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/symfony/yaml/Tests/DumperTest.php \Symfony\Component\Yaml\Tests\DumperTest::testSpecifications()
File
- vendor/
symfony/ yaml/ 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
->assertEquals($expected, $this->parser
->parse($this->dumper
->dump($expected, 10)), $test['test']);
}
}
}
}