Update to Symfony 8.0

This commit is contained in:
Alejandro Celaya
2025-12-02 12:11:56 +01:00
parent cfab13bc47
commit 1996745f64
9 changed files with 31 additions and 19 deletions

View File

@@ -114,6 +114,7 @@ class MatomoSendVisitsCommandTest extends TestCase
}
/**
* @param list<string> $input
* @return array{string, int, MatomoSendVisitsCommand}
*/
private function executeCommand(

View File

@@ -64,6 +64,9 @@ class DeleteShortUrlCommandTest extends TestCase
self::assertStringContainsString(sprintf('No URL found with short code "%s"', $shortCode), $output);
}
/**
* @param list<string> $retryAnswer
*/
#[Test, DataProvider('provideRetryDeleteAnswers')]
public function deleteIsRetriedWhenThresholdIsReachedAndQuestionIsAccepted(
array $retryAnswer,

View File

@@ -27,6 +27,9 @@ class DeleteShortUrlVisitsCommandTest extends TestCase
$this->commandTester = CliTestUtils::testerForCommand(new DeleteShortUrlVisitsCommand($this->deleter));
}
/**
* @param list<string> $input
*/
#[Test, DataProvider('provideCancellingInputs')]
public function executionIsAbortedIfManuallyCancelled(array $input): void
{

View File

@@ -81,7 +81,7 @@ class LocateVisitsCommandTest extends TestCase
->willReturnCallback($mockMethodBehavior);
$this->visitToLocation->expects(
$this->exactly($expectedUnlocatedCalls + $expectedEmptyCalls + $expectedAllCalls),
)->method('resolveVisitLocation')->withAnyParameters()->willReturn(Location::emptyInstance());
)->method('resolveVisitLocation')->withAnyParameters()->willReturn(Location::empty());
$this->downloadDbCommand->method('run')->willReturn(Command::SUCCESS);
$this->commandTester->setInputs(['y']);
@@ -204,6 +204,9 @@ class LocateVisitsCommandTest extends TestCase
self::assertStringContainsString('The --all flag has no effect on its own', $output);
}
/**
* @param list<string> $inputs
*/
#[Test, DataProvider('provideAbortInputs')]
public function processingAllCancelsCommandIfUserDoesNotActivelyAgreeToConfirmation(array $inputs): void
{

View File

@@ -40,9 +40,9 @@ class CliTestUtils
public static function testerForCommand(Command $mainCommand, Command ...$extraCommands): CommandTester
{
$app = new Application();
$app->add($mainCommand);
$app->addCommand($mainCommand);
foreach ($extraCommands as $command) {
$app->add($command);
$app->addCommand($command);
}
return new CommandTester($mainCommand);

View File

@@ -40,7 +40,7 @@ class LocateUnlocatedVisitsTest extends TestCase
public function visitToLocationHelperIsCalledToGeolocateVisits(): void
{
$visit = Visit::forBasePath(Visitor::empty());
$location = Location::emptyInstance();
$location = Location::empty();
$this->visitToLocation->expects($this->once())->method('resolveVisitLocation')->with($visit)->willReturn(
$location,

View File

@@ -67,7 +67,7 @@ class VisitLocatorTest extends TestCase
$this->visitService->{$serviceMethodName}(new class implements VisitGeolocationHelperInterface {
public function geolocateVisit(Visit $visit): Location
{
return Location::emptyInstance();
return Location::empty();
}
public function onVisitLocated(VisitLocation $visitLocation, Visit $visit): void