diff --git a/Tests/CacheWarmer/HydratorCacheWarmerTest.php b/Tests/CacheWarmer/HydratorCacheWarmerTest.php index bc370728..77e05bdf 100644 --- a/Tests/CacheWarmer/HydratorCacheWarmerTest.php +++ b/Tests/CacheWarmer/HydratorCacheWarmerTest.php @@ -11,6 +11,7 @@ use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; +use function method_exists; use function sys_get_temp_dir; use function unlink; @@ -66,12 +67,24 @@ public function testWarmerNotExecuted(int $autoGenerate): void try { $this->warmer->warmUp('meh'); - $this->assertFileNotExists($hydratorFilename); + // Replace by "assertFileDoesNotExist" when PHPUnit 9 is minimum + $this->assertFileDoesNotExistWithBC($hydratorFilename); } finally { @unlink($hydratorFilename); } } + private function assertFileDoesNotExistWithBC(string $filename): void + { + if (! method_exists($this, 'assertFileDoesNotExist')) { + $this->assertFileNotExists($filename); + + return; + } + + $this->assertFileDoesNotExist($filename); + } + /** * @return array */ diff --git a/Tests/DataCollector/CommandDataCollectorTest.php b/Tests/DataCollector/CommandDataCollectorTest.php index a48895b5..2008c57f 100644 --- a/Tests/DataCollector/CommandDataCollectorTest.php +++ b/Tests/DataCollector/CommandDataCollectorTest.php @@ -12,9 +12,6 @@ class CommandDataCollectorTest extends TestCase { - /** - * @doesNotPerformAssertions - */ public function testCollector(): void { $collector = new CommandDataCollector(new CommandLogger());