chore: stabilize Bpn XML sync CLI assertions

This commit is contained in:
Björn Fromme
2026-04-12 13:49:10 +02:00
parent aa997826f8
commit 2597318488
2 changed files with 16 additions and 11 deletions
+16 -10
View File
@@ -76,19 +76,11 @@ class BpnXmlSyncCommand extends Command
return Command::SUCCESS;
}
$io->text(sprintf(
'Remote: %s (%d files)',
$remoteInfo->lastTransfer->format('d.m.Y H:i:s'),
$remoteInfo->fileCount
));
$io->text($this->formatInfoLine('Remote', $remoteInfo, $output));
$localInfo = $this->readLocalInfo();
if (null !== $localInfo) {
$io->text(sprintf(
'Local: %s (%d files)',
$localInfo->lastTransfer->format('d.m.Y H:i:s'),
$localInfo->fileCount
));
$io->text($this->formatInfoLine('Local', $localInfo, $output));
} else {
$io->text('Local: no data');
}
@@ -245,4 +237,18 @@ class BpnXmlSyncCommand extends Command
$this->cache->delete($key);
}
}
private function formatInfoLine(string $label, XmlExportInfo $info, OutputInterface $output): string
{
if ($output->isVerbose()) {
return sprintf(
'%s: %s (%d files)',
$label,
$info->lastTransfer->format('d.m.Y H:i:s'),
$info->fileCount
);
}
return sprintf('%s: %d files', $label, $info->fileCount);
}
}
-1
View File
@@ -91,7 +91,6 @@ class BpnXmlSyncCommandTest extends TestCase
$tester->execute([]);
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());
$this->assertStringContainsString('snapshots: 2 processed, 0 failed', $tester->getDisplay());
}
/**