YamlTest.php in Loft Data Grids 7.2
File
vendor/symfony/yaml/Tests/YamlTest.php
View source
<?php
namespace Symfony\Component\Yaml\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Yaml;
class YamlTest extends TestCase {
public function testParseAndDump() {
$data = array(
'lorem' => 'ipsum',
'dolor' => 'sit',
);
$yml = Yaml::dump($data);
$parsed = Yaml::parse($yml);
$this
->assertEquals($data, $parsed);
}
public function testLegacyParseFromFile() {
$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);
}
}