Skip to content

Commit e67a5df

Browse files
committed
ErrorSuppressionTest::testSuppressFile(): fix bugs in test
This fixes two bugs in two test cases for the `testSuppressFile()` method: 1. The code snippet as was, contained a parse error (missing semi-colon after class instantiation). 2. The code snippet did not contain anything which would trigger the warning the test is looking for in the first place, so these two tests would always pass.
1 parent 9165a9a commit e67a5df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Core/ErrorSuppressionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ public function testSuppressFile()
751751
$this->assertCount(0, $warnings);
752752

753753
// Process late comment.
754-
$content = '<?php '.PHP_EOL.'class MyClass {}'.PHP_EOL.'$foo = new MyClass()'.PHP_EOL.'// phpcs:ignoreFile';
754+
$content = '<?php '.PHP_EOL.'class MyClass {}'.PHP_EOL.'$foo = new MyClass();'.PHP_EOL.'//TODO: write some code'.PHP_EOL.'// phpcs:ignoreFile';
755755
$file = new DummyFile($content, $ruleset, $config);
756756
$file->process();
757757

@@ -761,7 +761,7 @@ public function testSuppressFile()
761761
$this->assertCount(0, $warnings);
762762

763763
// Process late comment (deprecated syntax).
764-
$content = '<?php '.PHP_EOL.'class MyClass {}'.PHP_EOL.'$foo = new MyClass()'.PHP_EOL.'// @codingStandardsIgnoreFile';
764+
$content = '<?php '.PHP_EOL.'class MyClass {}'.PHP_EOL.'$foo = new MyClass();'.PHP_EOL.'//TODO: write some code'.PHP_EOL.'// @codingStandardsIgnoreFile';
765765
$file = new DummyFile($content, $ruleset, $config);
766766
$file->process();
767767

0 commit comments

Comments
 (0)