diff --git a/module/CLI/test/Command/Visit/DownloadGeoLiteDbCommandTest.php b/module/CLI/test/Command/Visit/DownloadGeoLiteDbCommandTest.php index 2b477f031..7fa46a05a 100644 --- a/module/CLI/test/Command/Visit/DownloadGeoLiteDbCommandTest.php +++ b/module/CLI/test/Command/Visit/DownloadGeoLiteDbCommandTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\CLI\Util\ExitCode; use Shlinkio\Shlink\Core\Exception\GeolocationDbUpdateFailedException; use Shlinkio\Shlink\Core\Geolocation\GeolocationDbUpdaterInterface; +use Shlinkio\Shlink\Core\Geolocation\GeolocationDownloadProgressHandlerInterface; use Shlinkio\Shlink\Core\Geolocation\GeolocationResult; use ShlinkioTest\Shlink\CLI\Util\CliTestUtils; use Symfony\Component\Console\Tester\CommandTester; @@ -36,9 +37,9 @@ public function showsProperMessageWhenGeoLiteUpdateFails( int $expectedExitCode, ): void { $this->dbUpdater->expects($this->once())->method('checkDbUpdate')->withAnyParameters()->willReturnCallback( - function (callable $beforeDownload, callable $handleProgress) use ($olderDbExists): void { - $beforeDownload($olderDbExists); - $handleProgress(100, 50); + function (GeolocationDownloadProgressHandlerInterface $handler) use ($olderDbExists): void { + $handler->beforeDownload($olderDbExists); + $handler->handleProgress(100, 50, $olderDbExists); throw $olderDbExists ? GeolocationDbUpdateFailedException::withOlderDb() @@ -105,8 +106,8 @@ public function printsExpectedMessageWhenNoErrorOccurs(callable $checkUpdateBeha public static function provideSuccessParams(): iterable { yield 'up to date db' => [fn () => GeolocationResult::CHECK_SKIPPED, '[INFO] GeoLite2 db file is up to date.']; - yield 'outdated db' => [function (callable $beforeDownload): GeolocationResult { - $beforeDownload(true); + yield 'outdated db' => [function (GeolocationDownloadProgressHandlerInterface $handler): GeolocationResult { + $handler->beforeDownload(true); return GeolocationResult::DB_CREATED; }, '[OK] GeoLite2 db file properly downloaded.']; }