diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index cf433db..30d6681 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -18,7 +18,7 @@ jobs: - php-version: '7.2' dependency-versions: 'lowest' php-extensions: 'mysql, gd' - tools: 'composer:v1' + tools: 'composer:v2' env: SYMFONY_DEPRECATIONS_HELPER: disabled diff --git a/Tests/Application/config/bootstrap.php b/Tests/Application/config/bootstrap.php index 3bc0a8f..b380d97 100644 --- a/Tests/Application/config/bootstrap.php +++ b/Tests/Application/config/bootstrap.php @@ -21,6 +21,10 @@ require $file; +if (!\trait_exists(Prophecy\PhpUnit\ProphecyTrait::class)) { // backwards compatibility layer for < PHP 7.3 + require __DIR__ . '/../../prophecy-trait-bc-layer.php'; +} + // Load cached env vars if the .env.local.php file exists // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { diff --git a/Tests/Unit/Controller/RedirectRouteImportControllerTest.php b/Tests/Unit/Controller/RedirectRouteImportControllerTest.php index f29438c..157a553 100644 --- a/Tests/Unit/Controller/RedirectRouteImportControllerTest.php +++ b/Tests/Unit/Controller/RedirectRouteImportControllerTest.php @@ -107,7 +107,7 @@ public function testImportActionConverterNotFound() $import->import(Argument::any())->willThrow(ConverterNotFoundException::class); $controller = new RedirectRouteImportController($import->reveal(), $this->importPath); - $response = $controller->postAction($request->reveal(), $this->importPath); + $response = $controller->postAction($request, $this->importPath); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertEquals(400, $response->getStatusCode()); @@ -122,7 +122,7 @@ public function testImportActionNoFile() $import->import(Argument::any())->shouldNotBeCalled(); $controller = new RedirectRouteImportController($import->reveal(), $this->importPath); - $response = $controller->postAction($request->reveal(), $this->importPath); + $response = $controller->postAction($request, $this->importPath); $this->assertInstanceOf(JsonResponse::class, $response); $this->assertEquals(400, $response->getStatusCode()); diff --git a/Tests/prophecy-trailt-bc-layer.php b/Tests/prophecy-trait-bc-layer.php similarity index 100% rename from Tests/prophecy-trailt-bc-layer.php rename to Tests/prophecy-trait-bc-layer.php diff --git a/Tests/test-bootstrap.php b/Tests/test-bootstrap.php index 9bd366c..42d9d77 100644 --- a/Tests/test-bootstrap.php +++ b/Tests/test-bootstrap.php @@ -12,7 +12,3 @@ */ require __DIR__ . '/Application/config/bootstrap.php'; - -if (!\trait_exists(Prophecy\PhpUnit\ProphecyTrait::class)) { // backwards compatibility layer for < PHP 7.3 - require __DIR__ . '/prophecy-trait-bc-layer.php'; -} diff --git a/phpstan.neon b/phpstan.neon index eb7045b..9c81319 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -14,6 +14,7 @@ parameters: excludePaths: - %currentWorkingDirectory%/vendor/* - %currentWorkingDirectory%/Tests/Application/var/* + - %currentWorkingDirectory%/Tests/prophecy-trait-bc-layer.php symfony: container_xml_path: %currentWorkingDirectory%/Tests/Application/var/cache/admin/dev/Sulu_Bundle_RedirectBundle_Tests_Application_KernelDevDebugContainer.xml console_application_loader: Tests/phpstan/console-application.php