X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fyaml%2FTests%2FCommand%2FLintCommandTest.php;h=a5baf234ef3dfa05258814ad2d43daf6e42bfb26;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=ce6ad480cf2b6e1e0c7c09fa145a3ead5b813574;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/vendor/symfony/yaml/Tests/Command/LintCommandTest.php b/vendor/symfony/yaml/Tests/Command/LintCommandTest.php index ce6ad480c..a5baf234e 100644 --- a/vendor/symfony/yaml/Tests/Command/LintCommandTest.php +++ b/vendor/symfony/yaml/Tests/Command/LintCommandTest.php @@ -12,10 +12,10 @@ namespace Symfony\Component\Yaml\Tests\Command; use PHPUnit\Framework\TestCase; -use Symfony\Component\Yaml\Command\LintCommand; use Symfony\Component\Console\Application; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; +use Symfony\Component\Yaml\Command\LintCommand; /** * Tests the YamlLintCommand. @@ -51,6 +51,33 @@ bar'; $this->assertContains('Unable to parse at line 3 (near "bar").', trim($tester->getDisplay())); } + public function testConstantAsKey() + { + $yaml = <<createCommandTester()->execute(array('filename' => $this->createFile($yaml)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)); + $this->assertSame(0, $ret, 'lint:yaml exits with code 0 in case of success'); + } + + public function testCustomTags() + { + $yaml = <<createCommandTester()->execute(array('filename' => $this->createFile($yaml), '--parse-tags' => true), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)); + $this->assertSame(0, $ret, 'lint:yaml exits with code 0 in case of success'); + } + + public function testCustomTagsError() + { + $yaml = <<createCommandTester()->execute(array('filename' => $this->createFile($yaml)), array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)); + $this->assertSame(1, $ret, 'lint:yaml exits with code 1 in case of error'); + } + /** * @expectedException \RuntimeException */ @@ -105,3 +132,8 @@ bar'; rmdir(sys_get_temp_dir().'/framework-yml-lint-test'); } } + +class Foo +{ + const TEST = 'foo'; +}