diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abdbc56..1d06f95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,25 +18,20 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 7.3, 8.0] + php: [7.4, 8.0] symfony: [^4.4, ^5.2] - sylius: [~1.8.0, ~1.9.0, ~1.10.0] + sylius: [~1.9, ~1.10, ~1.11] node: [14.x] - mysql: [5.7] + mysql: [8.0] exclude: - - - sylius: ~1.8.0 - symfony: ^5.2 - - + - sylius: ~1.9 php: 8.0 - sylius: ~1.8.0 - - - php: 8.0 - sylius: ~1.9.0 - - - php: 7.3 - sylius: ~1.10.0 + - sylius: ~1.10 + symfony: 4.4 + - sylius: ~1.11 + php: 7.4 + env: APP_ENV: test @@ -116,7 +111,7 @@ jobs: - name: Install PHP dependencies - run: composer install --no-interaction + run: composer install --no-interaction --no-scripts - name: Get Yarn cache directory diff --git a/behat.yml.dist b/behat.yml.dist index 1f19bf0..317bf3c 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -21,6 +21,7 @@ default: symfony: ~ chrome_headless: chrome: + socket_timeout: 60 api_url: http://127.0.0.1:9222 validate_certificate: false chrome: diff --git a/composer.json b/composer.json index 0b93345..7df5a0e 100644 --- a/composer.json +++ b/composer.json @@ -5,11 +5,12 @@ "description": "MultiSafepay payment plugin for Sylius applications.", "license": "MIT", "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "multisafepay/api": "^2.0", - "sylius/sylius": "~1.8.0 || ~1.9.0 || ~1.10.0" + "sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0" }, "require-dev": { + "babdev/pagerfanta-bundle": "^2.5", "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "^1.4", "dmore/behat-chrome-extension": "^1.3", @@ -30,6 +31,7 @@ "phpstan/phpstan-strict-rules": "^0.12.0", "phpstan/phpstan-webmozart-assert": "0.12.12", "phpunit/phpunit": "^9.5", + "polishsymfonycommunity/symfony-mocker-container": "^1.0", "sensiolabs/security-checker": "^6.0", "sylius-labs/coding-standard": "^4.0", "symfony/browser-kit": "^4.4 || ^5.2", diff --git a/tests/Application/.env b/tests/Application/.env index 4b49a96..ab99ad1 100644 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -27,3 +27,11 @@ JWT_PASSPHRASE=acme_plugin_development # Delivery is disabled by default via "null://localhost" MAILER_URL=smtp://localhost ###< symfony/swiftmailer-bundle ### + +###> symfony/messenger ### +# Choose one of the transports below +# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages +# MESSENGER_TRANSPORT_DSN=doctrine://default +# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages +MESSENGER_TRANSPORT_DSN=sync:// +###< symfony/messenger ### diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index a9e400f..f993094 100644 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -68,7 +68,7 @@ protected function configureRoutes(RouteCollectionBuilder $routes): void protected function getContainerBaseClass(): string { - if ($this->isTestEnvironment()) { + if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) { return MockerContainer::class; } diff --git a/tests/Application/config/api_platform/.gitkeep b/tests/Application/config/api_platform/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/Application/config/sylius/1.11/bundles.php b/tests/Application/config/sylius/1.11/bundles.php new file mode 100644 index 0000000..400b877 --- /dev/null +++ b/tests/Application/config/sylius/1.11/bundles.php @@ -0,0 +1,9 @@ + ['all' => true], + SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], + Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], +]; diff --git a/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml new file mode 100644 index 0000000..2f32a9b --- /dev/null +++ b/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml @@ -0,0 +1,12 @@ +jms_serializer: + visitors: + json_serialization: + options: + - JSON_PRETTY_PRINT + - JSON_UNESCAPED_SLASHES + - JSON_PRESERVE_ZERO_FRACTION + json_deserialization: + options: + - JSON_PRETTY_PRINT + - JSON_UNESCAPED_SLASHES + - JSON_PRESERVE_ZERO_FRACTION diff --git a/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml new file mode 100644 index 0000000..ed7bc61 --- /dev/null +++ b/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml @@ -0,0 +1,4 @@ +jms_serializer: + visitors: + xml_serialization: + format_output: '%kernel.debug%' diff --git a/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml new file mode 100644 index 0000000..c288182 --- /dev/null +++ b/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml @@ -0,0 +1,10 @@ +jms_serializer: + visitors: + json_serialization: + options: + - JSON_UNESCAPED_SLASHES + - JSON_PRESERVE_ZERO_FRACTION + json_deserialization: + options: + - JSON_UNESCAPED_SLASHES + - JSON_PRESERVE_ZERO_FRACTION diff --git a/tests/Application/config/sylius/1.8/packages/security.yaml b/tests/Application/config/sylius/1.11/packages/security.yaml similarity index 95% rename from tests/Application/config/sylius/1.8/packages/security.yaml rename to tests/Application/config/sylius/1.11/packages/security.yaml index 8161bda..1062810 100644 --- a/tests/Application/config/sylius/1.8/packages/security.yaml +++ b/tests/Application/config/sylius/1.11/packages/security.yaml @@ -54,10 +54,6 @@ security: target: sylius_admin_login anonymous: true - oauth_token: - pattern: "%sylius.security.api_regex%/oauth/v2/token" - security: false - new_api_admin_user: pattern: "%sylius.security.new_api_route%/admin-user-authentication-token" provider: sylius_admin_user_provider @@ -97,13 +93,6 @@ security: authenticators: - lexik_jwt_authentication.jwt_token_authenticator - api: - pattern: "%sylius.security.api_regex%/.*" - provider: sylius_admin_user_provider - fos_oauth: true - stateless: true - anonymous: true - shop: switch_user: { role: ROLE_ALLOWED_TO_SWITCH } context: shop diff --git a/tests/Application/config/sylius/1.8/bundles.php b/tests/Application/config/sylius/1.8/bundles.php deleted file mode 100644 index c3c8ea4..0000000 --- a/tests/Application/config/sylius/1.8/bundles.php +++ /dev/null @@ -1,8 +0,0 @@ - ['all' => true], - WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true], - FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true], - Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true], -]; diff --git a/tests/Application/config/sylius/1.8/packages/_sylius.yaml b/tests/Application/config/sylius/1.8/packages/_sylius.yaml deleted file mode 100644 index 1674a97..0000000 --- a/tests/Application/config/sylius/1.8/packages/_sylius.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" } diff --git a/tests/Application/config/sylius/1.8/routes/sylius_admin_api.yaml b/tests/Application/config/sylius/1.8/routes/sylius_admin_api.yaml deleted file mode 100644 index 80aed45..0000000 --- a/tests/Application/config/sylius/1.8/routes/sylius_admin_api.yaml +++ /dev/null @@ -1,3 +0,0 @@ -sylius_admin_api: - resource: "@SyliusAdminApiBundle/Resources/config/routing.yml" - prefix: /api