Skip to content

Commit

Permalink
BC Layer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 24, 2024
1 parent 0058ea2 commit 14162a0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
extensions: 'mysql, imagick'
tools: 'composer:v2'
coverage: none
Expand Down
4 changes: 4 additions & 0 deletions Tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Controller/RedirectRouteImportControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions Tests/test-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 14162a0

Please sign in to comment.