Skip to content

Commit d9b6f3c

Browse files
committed
Tests/AcceptTest: minor tweaks
* Import all used classes. * Make the data provider static. * Prevent a potential call to `stty` by setting the report width.
1 parent 43c8520 commit d9b6f3c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/Core/Filters/Filter/AcceptTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHP_CodeSniffer\Filters\Filter;
1515
use PHP_CodeSniffer\Ruleset;
1616
use PHP_CodeSniffer\Tests\Core\Filters\AbstractFilterTestCase;
17+
use RecursiveArrayIterator;
1718

1819
/**
1920
* Tests for the \PHP_CodeSniffer\Filters\Filter::accept method.
@@ -34,7 +35,7 @@ class AcceptTest extends AbstractFilterTestCase
3435
public static function initializeConfigAndRuleset()
3536
{
3637
$standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml';
37-
self::$config = new Config(["--standard=$standard", "--ignore=*/somethingelse/*"]);
38+
self::$config = new Config(["--standard=$standard", '--ignore=*/somethingelse/*', '--report-width=80']);
3839
self::$ruleset = new Ruleset(self::$config);
3940

4041
}//end initializeConfigAndRuleset()
@@ -52,7 +53,7 @@ public static function initializeConfigAndRuleset()
5253
*/
5354
public function testExcludePatterns($inputPaths, $expectedOutput)
5455
{
55-
$fakeDI = new \RecursiveArrayIterator($inputPaths);
56+
$fakeDI = new RecursiveArrayIterator($inputPaths);
5657
$filter = new Filter($fakeDI, '/', self::$config, self::$ruleset);
5758

5859
$this->assertEquals($expectedOutput, $this->getFilteredResultsAsArray($filter));
@@ -67,7 +68,7 @@ public function testExcludePatterns($inputPaths, $expectedOutput)
6768
*
6869
* @return array<string, array<string, array<string>>>
6970
*/
70-
public function dataExcludePatterns()
71+
public static function dataExcludePatterns()
7172
{
7273
$testCases = [
7374
// Test top-level exclude patterns.

0 commit comments

Comments
 (0)