Skip to content

Commit 23f4ff8

Browse files
authored
minor #346 [Maintenance] Support stable Sylius v1.11.0 (GSadee)
This PR was merged into the 1.0-dev branch. Discussion ---------- Commits ------- 1ea12d4 [Maintenance] Support stable Sylius v1.11.0
2 parents e6b5057 + 1ea12d4 commit 23f4ff8

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
matrix:
2121
php: ["8.0"]
2222
symfony: ["^4.4", "^5.4"]
23-
sylius: ["~1.10.0"]
23+
sylius: ["~1.10.0", "~1.11.0"]
2424
node: ["14.x"]
2525
mysql: ["5.7", "8.0"]
2626

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"phpstan/phpstan": "0.12.96",
4747
"phpstan/phpstan-webmozart-assert": "0.12.12",
4848
"phpunit/phpunit": "^9.5",
49+
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
4950
"sylius-labs/coding-standard": "~4.0.0",
5051
"symfony/browser-kit": "^4.4 || ^5.4",
5152
"symfony/debug-bundle": "^4.4 || ^5.4",

tests/Application/.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
3131
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
3232
JWT_PASSPHRASE=66d45daf91b2ed1031e62d81c81dba2e
3333
###< lexik/jwt-authentication-bundle ###
34+
35+
###> symfony/messenger ###
36+
# Choose one of the transports below
37+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
38+
MESSENGER_TRANSPORT_DSN=doctrine://default
39+
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
40+
###< symfony/messenger ###

tests/Application/.env.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ KERNEL_CLASS='Tests\Sylius\RefundPlugin\Application\Kernel'
55
###> knplabs/knp-snappy-bundle ###
66
WKHTMLTOPDF_PATH="%kernel.project_dir%/etc/wkhtmltopdf"
77
###< knplabs/knp-snappy-bundle ###
8+
9+
###> symfony/messenger ###
10+
# Sync transport turned for testing env for the ease of testing
11+
MESSENGER_TRANSPORT_DSN=sync://
12+
###< symfony/messenger ###

tests/Application/Kernel.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function configureRoutes(RouteCollectionBuilder $routes): void
6868

6969
protected function getContainerBaseClass(): string
7070
{
71-
if ($this->isTestEnvironment()) {
71+
if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) {
7272
return MockerContainer::class;
7373
}
7474

@@ -101,6 +101,14 @@ private function loadRoutesConfiguration(RouteCollectionBuilder $routes, string
101101
private function registerBundlesFromFile(string $bundlesFile): iterable
102102
{
103103
$contents = require $bundlesFile;
104+
105+
if (SyliusKernel::MINOR_VERSION > 10) {
106+
$contents = array_merge(
107+
['Sylius\Calendar\SyliusCalendarBundle' => ['all' => true]],
108+
$contents
109+
);
110+
}
111+
104112
foreach ($contents as $class => $envs) {
105113
if (isset($envs['all']) || isset($envs[$this->environment])) {
106114
yield new $class();

tests/Application/config/api_platform/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)