diff --git a/tests/Command/GeocodeCommandTest.php b/tests/Command/GeocodeCommandTest.php index 203ef8e..dafb43d 100644 --- a/tests/Command/GeocodeCommandTest.php +++ b/tests/Command/GeocodeCommandTest.php @@ -66,7 +66,12 @@ public function testExecute(): void ->willReturn([]); $app = new Application($kernel); - $app->add((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); + if (method_exists($app, 'addCommand')) { + // since Symfony 8 + $app->addCommand((new GeocodeCommand($geocoder))->setName('geocoder:geocode')); + } else { + $app->add(new GeocodeCommand($geocoder)); + } $command = $app->find('geocoder:geocode'); diff --git a/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php b/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php index 0b7f3f7..b6c43b7 100644 --- a/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php +++ b/tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php @@ -33,7 +33,9 @@ protected function tearDown(): void { $reflection = new \ReflectionObject($this->compilerPass); $prop = $reflection->getProperty('factoryServiceIds'); - $prop->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $prop->setAccessible(true); + } $prop->setValue(null, []); }