Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions etc/qa/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
parameters:
ignoreErrors:
- '#Method WyriHaximus\\TestUtilities\\TestCase::setUp\(\) is not final, but since the containing class is abstract, it should be.#'
- '#Method WyriHaximus\\TestUtilities\\TestCase::tearDown\(\) is not final, but since the containing class is abstract, it should be.#'

includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
13 changes: 5 additions & 8 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ abstract class TestCase extends PHPUnitTestCase
use MockeryPHPUnitIntegration;

public const string WINDOWS_TEMP_DIR_PREFIX = 'C:\\t\\';
public const int DEFAULT_AWAIT_TIMEOUT = 60;
public const int WIN_START = 0;
public const int WIN_END = 2;
public const int USLEEP = 50;
Expand Down Expand Up @@ -68,13 +67,11 @@ protected function tearDown(): void
$this->rmdir($this->baseTmpDir);
}

/** @return array<int, array<int, bool>> */
final public static function provideTrueFalse(): array
/** @return iterable<array<bool>> */
final public static function provideTrueFalse(): iterable
{
return [
[true],
[false],
];
yield 'true' => [true];
yield 'false' => [false];
}

final protected function getSysTempDir(): string
Expand Down Expand Up @@ -121,7 +118,7 @@ final protected function getRandomNameSpace(): string
return $this->tmpNamespace;
}

/** @return array<string> */
/** @return list<string> */
final protected function getFilesInDirectory(string $path): array
{
$files = [];
Expand Down
10 changes: 9 additions & 1 deletion tests/TestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,19 @@ public function testTemporaryDirectoryAndGetFilesInDirectory(string $int): void
}

/** @dataProvider provideTrueFalse */
public static function testTrueFalse(bool $bool): void
public function testTrueOrFalse(bool $bool): void
{
static::assertCount(1, func_get_args());
}

public function testTrueAndFalse(): void
{
static::assertSame(
['true' => [true], 'false' => [false]],
[...self::provideTrueFalse()],
);
}

public function testGetSysTempDir(): void
{
self::assertFileExists($this->getSysTempDir());
Expand Down
Loading