8000 Add test for mixed linter config · symfony/symfony@1ca3b9b · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ca3b9b

Browse files
Add test for mixed linter config
1 parent 45d803a commit 1ca3b9b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,24 @@ public function testCorrectLintConfig()
183183
$this->assertStringContainsString('All 1 YAML files contain valid syntax.', trim($tester->getDisplay()));
184184
}
185185

186+
public function testMixedLintConfig()
187+
{
188+
$tester = $this->createCommandTester();
189+
$filename1 = $this->createFile('foo: include');
190+
$filename2 = $this->createFile('foo: exclude');
191+
192+
$yaml = <<<YAML
193+
yaml-lint:
194+
format: txt
195+
excludes:
196+
- $filename2
197+
YAML;
198+
199+
$ret = $tester->execute(['filename' => [$filename1, $filename2], '--config' => $this->createFile($yaml)], ['decorated' => false]);
200+
$this->assertSame(0, $ret, 'lint:yaml exits with code 0 in case of success');
201+
$this->assertStringContainsString('All 1 YAML files contain valid syntax.', trim($tester->getDisplay()));
202+
}
203+
186204
public function testOverrideLintConfig()
187205
{
188206
$tester = $this->createCommandTester();

0 commit comments

Comments
 (0)
0