for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Slince\Config\Tests\Parser;
use PHPUnit\Framework\TestCase;
use Slince\Config\Parser\YamlParser;
use Slince\Config\Exception\ParseException;
class YamlParserTest extends TestCase
{
public function testParse()
$parser = new YamlParser();
$data = $parser->parse(__DIR__ . '/../Fixtures/config.yml');
$this->assertEquals([
'foo' => 'bar',
'bar' => 'baz',
], $data);
}
public function testException()
$this->setExpectedException(ParseException::class);
(new YamlParser())->parse(__DIR__ . '/../Fixtures/syntax_yml_file.yml');
public function testDump()
$file = __DIR__ . '/../Tmp/yaml-dump.yml';
$this->assertTrue($parser->dump($file, [
'foo' => 'bar'
]));
], $parser->parse($file));