chore: stabilize Bpn XML sync CLI assertions
This commit is contained in:
@@ -76,19 +76,11 @@ class BpnXmlSyncCommand extends Command
|
|||||||
return Command::SUCCESS;
|
return Command::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$io->text(sprintf(
|
$io->text($this->formatInfoLine('Remote', $remoteInfo, $output));
|
||||||
'Remote: %s (%d files)',
|
|
||||||
$remoteInfo->lastTransfer->format('d.m.Y H:i:s'),
|
|
||||||
$remoteInfo->fileCount
|
|
||||||
));
|
|
||||||
|
|
||||||
$localInfo = $this->readLocalInfo();
|
$localInfo = $this->readLocalInfo();
|
||||||
if (null !== $localInfo) {
|
if (null !== $localInfo) {
|
||||||
$io->text(sprintf(
|
$io->text($this->formatInfoLine('Local', $localInfo, $output));
|
||||||
'Local: %s (%d files)',
|
|
||||||
$localInfo->lastTransfer->format('d.m.Y H:i:s'),
|
|
||||||
$localInfo->fileCount
|
|
||||||
));
|
|
||||||
} else {
|
} else {
|
||||||
$io->text('Local: no data');
|
$io->text('Local: no data');
|
||||||
}
|
}
|
||||||
@@ -245,4 +237,18 @@ class BpnXmlSyncCommand extends Command
|
|||||||
$this->cache->delete($key);
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ class BpnXmlSyncCommandTest extends TestCase
|
|||||||
$tester->execute([]);
|
$tester->execute([]);
|
||||||
|
|
||||||
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());
|
$this->assertSame(Command::SUCCESS, $tester->getStatusCode());
|
||||||
$this->assertStringContainsString('snapshots: 2 processed, 0 failed', $tester->getDisplay());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user