Skip to content

Commit c0271bd

Browse files
authored
Merge pull request #1066 from PHPCSStandards/phpcs-4.0/feature/standardrulesetqatest-fix-test
StandardRulesetsQATest: fix the test
2 parents ddfd56a + ae72b98 commit c0271bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/Core/Standards/StandardRulesetsQATest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use PHP_CodeSniffer\Ruleset;
1212
use PHP_CodeSniffer\Tests\ConfigDouble;
1313
use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase;
14+
use PHP_CodeSniffer\Tests\Core\StatusWriterTestHelper;
1415

1516
/**
1617
* Tests that pre-defined standards do not throw errors.
@@ -19,6 +20,7 @@
1920
*/
2021
final class StandardRulesetsQATest extends AbstractRulesetTestCase
2122
{
23+
use StatusWriterTestHelper;
2224

2325

2426
/**
@@ -36,15 +38,13 @@ final class StandardRulesetsQATest extends AbstractRulesetTestCase
3638
*/
3739
public function testBuildInStandardsDoNotContainErrors($standard)
3840
{
39-
ob_start();
41+
$this->expectNoStdoutOutput();
42+
4043
$config = new ConfigDouble(["--standard=$standard"]);
4144
$ruleset = new Ruleset($config);
4245

43-
$seenOutput = ob_get_contents();
44-
ob_end_clean();
45-
4646
// Make sure no messages were thrown.
47-
$this->assertSame('', $seenOutput);
47+
$this->assertStderrOutputSameString('');
4848

4949
// Make sure sniffs were registered.
5050
$this->assertGreaterThanOrEqual(1, count($ruleset->sniffCodes));

0 commit comments

Comments
 (0)