feat: upgrade phpunit to 12.5

This commit is contained in:
Björn Fromme
2026-08-31 09:31:00 +02:00
parent 010cfe56b2
commit bfad61f1dd
95 changed files with 1436 additions and 1224 deletions
+29 -25
View File
@@ -27,12 +27,14 @@ class BpnXmlSyncCommandTest extends TestCase
private TravelLoader $travelLoader;
private TravelDataProvider $travelDataService;
private TravelSnapshotManager $travelSnapshotService;
private BpnXmlSnapshotRefreshManager $snapshotRefreshManager;
private BpnXmlSyncManager $syncManager;
private BpnXmlSyncCommand $command;
private ?BpnXmlSyncCommand $command = null;
protected function tearDown(): void
{
if (null === $this->command) {
return;
}
$release = new \ReflectionMethod($this->command, 'release');
$release->setAccessible(true);
$release->invoke($this->command);
@@ -40,30 +42,30 @@ class BpnXmlSyncCommandTest extends TestCase
protected function setUp(): void
{
$this->xmlSource = $this->createMock(FilesystemOperator::class);
$this->xmlExport = $this->createMock(FilesystemOperator::class);
$this->xmlSource = $this->createStub(FilesystemOperator::class);
$this->xmlExport = $this->createStub(FilesystemOperator::class);
$this->cache = $this->createMock(TagAwareCacheInterface::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->logger = $this->createStub(LoggerInterface::class);
$this->travelLoader = $this->createMock(TravelLoader::class);
$this->travelDataService = $this->createMock(TravelDataProvider::class);
$this->travelSnapshotService = $this->createMock(TravelSnapshotManager::class);
$this->snapshotRefreshManager = new BpnXmlSnapshotRefreshManager(
$this->travelLoader,
$this->travelDataService,
$this->travelSnapshotService,
$this->logger,
);
}
$this->syncManager = new BpnXmlSyncManager(
$this->xmlSource,
$this->xmlExport,
$this->cache,
$this->logger,
);
$this->command = new BpnXmlSyncCommand(
$this->syncManager,
$this->snapshotRefreshManager,
private function command(): BpnXmlSyncCommand
{
return $this->command ??= new BpnXmlSyncCommand(
new BpnXmlSyncManager(
$this->xmlSource,
$this->xmlExport,
$this->cache,
$this->logger,
),
new BpnXmlSnapshotRefreshManager(
$this->travelLoader,
$this->travelDataService,
$this->travelSnapshotService,
$this->logger,
),
$this->logger,
);
}
@@ -101,7 +103,7 @@ class BpnXmlSyncCommandTest extends TestCase
->method('invalidateTags')
->with(['xml-sync']);
$tester = new CommandTester($this->command);
$tester = new CommandTester($this->command());
$tester->execute([]);
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());
@@ -121,7 +123,7 @@ class BpnXmlSyncCommandTest extends TestCase
$this->travelSnapshotService->expects($this->never())->method('purgeOrphanedFutureSnapshots');
$this->cache->expects($this->never())->method('invalidateTags');
$tester = new CommandTester($this->command);
$tester = new CommandTester($this->command());
$tester->execute([]);
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());
@@ -129,6 +131,8 @@ class BpnXmlSyncCommandTest extends TestCase
public function testSnapshotSyncIsSkippedAndWarningLoggedWhenFileMapGenerationFails(): void
{
$this->logger = $this->createMock(LoggerInterface::class);
$newerTimestamp = "24.03.2026 12:00:00\nExport\n3 Dateien\n";
$olderTimestamp = "24.03.2026 10:00:00\nExport\n3 Dateien\n";
@@ -153,7 +157,7 @@ class BpnXmlSyncCommandTest extends TestCase
$this->travelSnapshotService->expects($this->never())->method('purgeOrphanedFutureSnapshots');
$this->cache->expects($this->once())->method('invalidateTags')->with(['xml-sync']);
$tester = new CommandTester($this->command);
$tester = new CommandTester($this->command());
$tester->execute([]);
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());