YamlTest.php in Loft Data Grids 6.2
File
vendor/symfony/yaml/Symfony/Component/Yaml/Tests/YamlTest.php
View source
<?php
namespace Symfony\Component\Yaml\Tests;
use Symfony\Component\Yaml\Yaml;
class YamlTest extends \PHPUnit_Framework_TestCase {
public function testParseAndDump() {
$data = array(
'lorem' => 'ipsum',
'dolor' => 'sit',
);
$yml = Yaml::dump($data);
$parsed = Yaml::parse($yml);
$this
->assertEquals($data, $parsed);
$filename = __DIR__ . '/Fixtures/index.yml';
$contents = file_get_contents($filename);
$parsedByFilename = Yaml::parse($filename);
$parsedByContents = Yaml::parse($contents);
$this
->assertEquals($parsedByFilename, $parsedByContents);
}
public function testZeroIndentationThrowsException() {
Yaml::dump(array(
'lorem' => 'ipsum',
'dolor' => 'sit',
), 2, 0);
}
public function testNegativeIndentationThrowsException() {
Yaml::dump(array(
'lorem' => 'ipsum',
'dolor' => 'sit',
), 2, -4);
}
}