Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/Cloudflare-CPanel-7.0.1/vendor/symfony/yaml/Tests/ |
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ 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); } /** * @group legacy */ 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); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The indentation must be greater than zero */ public function testZeroIndentationThrowsException() { Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, 0); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The indentation must be greater than zero */ public function testNegativeIndentationThrowsException() { Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, -4); } }