From 67f6cfe98984998bddef7e4a75c6969591fa962a Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 24 Jul 2024 16:11:05 +0200 Subject: [PATCH] BC Layer --- Tests/Application/config/bootstrap.php | 5 +++++ .../RedirectRouteImportControllerTest.php | 4 ++-- Tests/prophecy-trailt-bc-layer.php | 19 ------------------- Tests/test-bootstrap.php | 4 ---- 4 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 Tests/prophecy-trailt-bc-layer.php diff --git a/Tests/Application/config/bootstrap.php b/Tests/Application/config/bootstrap.php index 3bc0a8f..1e7086b 100644 --- a/Tests/Application/config/bootstrap.php +++ b/Tests/Application/config/bootstrap.php @@ -21,6 +21,11 @@ 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-trailt-bc-layer.php deleted file mode 100644 index 55757af..0000000 --- a/Tests/prophecy-trailt-bc-layer.php +++ /dev/null @@ -1,19 +0,0 @@ -