Skip to content

Commit f89dad4

Browse files
authored
Merge pull request #973 from WyriHaximus/resolve-new-phpstan-errors
Resolve new PHPStan errors
2 parents 2c524e5 + e42e1fc commit f89dad4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

etc/qa/phpstan.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
parameters:
2-
ignoreErrors:
3-
- '#Method WyriHaximus\\TestUtilities\\TestCase::setUp\(\) is not final, but since the containing class is abstract, it should be.#'
4-
- '#Method WyriHaximus\\TestUtilities\\TestCase::tearDown\(\) is not final, but since the containing class is abstract, it should be.#'
5-
61
includes:
72
- phar://phpstan.phar/conf/bleedingEdge.neon

src/TestCase.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ abstract class TestCase extends PHPUnitTestCase
3333
use MockeryPHPUnitIntegration;
3434

3535
public const string WINDOWS_TEMP_DIR_PREFIX = 'C:\\t\\';
36-
public const int DEFAULT_AWAIT_TIMEOUT = 60;
3736
public const int WIN_START = 0;
3837
public const int WIN_END = 2;
3938
public const int USLEEP = 50;
@@ -68,13 +67,11 @@ protected function tearDown(): void
6867
$this->rmdir($this->baseTmpDir);
6968
}
7069

71-
/** @return array<int, array<int, bool>> */
72-
final public static function provideTrueFalse(): array
70+
/** @return iterable<array<bool>> */
71+
final public static function provideTrueFalse(): iterable
7372
{
74-
return [
75-
[true],
76-
[false],
77-
];
73+
yield 'true' => [true];
74+
yield 'false' => [false];
7875
}
7976

8077
final protected function getSysTempDir(): string
@@ -121,7 +118,7 @@ final protected function getRandomNameSpace(): string
121118
return $this->tmpNamespace;
122119
}
123120

124-
/** @return array<string> */
121+
/** @return list<string> */
125122
final protected function getFilesInDirectory(string $path): array
126123
{
127124
$files = [];

tests/TestCaseTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ public function testTemporaryDirectoryAndGetFilesInDirectory(string $int): void
7979
}
8080

8181
/** @dataProvider provideTrueFalse */
82-
public static function testTrueFalse(bool $bool): void
82+
public function testTrueOrFalse(bool $bool): void
8383
{
8484
static::assertCount(1, func_get_args());
8585
}
8686

87+
public function testTrueAndFalse(): void
88+
{
89+
static::assertSame(
90+
['true' => [true], 'false' => [false]],
91+
[...self::provideTrueFalse()],
92+
);
93+
}
94+
8795
public function testGetSysTempDir(): void
8896
{
8997
self::assertFileExists($this->getSysTempDir());

0 commit comments

Comments
 (0)