Skip to content

Commit 3349335

Browse files
OP-273 - Feature/sylius 1.13 update (#241)
* OP-273 - remove sylius 1.11 config files * OP-273 - add missing changes from sylius upgrade guide * OP-273 - set package.json.1.13 as default packages.json * OP-273 - order composer packages in alphabetical order, remove sylius 1.11 support, update dependencies * OP-273 - update composer.json * update symfony workflow build * upgrade bitbag coding standard package * fix gh action build configuration * fix gh action config * OP-273 - temporary disable gh action on push * OP-273 - downgrade bitbag coding standards package * OP-273 - update ecs configuration * OP-273 - fix ecs * OP-273 - remove symfony flex package * fix phpspec test * OP-273 - add conflict with behat/mink-selenium2-driver * OP-273 - set 2 decimal digit in behat tests. Add node information in gh actions * OP-273 - set thousends coma in behat scenarios. * OP-273 - try to fix plugin on symfony 6 * OP-273 - restore gh actions on push
1 parent 6c54783 commit 3349335

File tree

17 files changed

+78
-141
lines changed

17 files changed

+78
-141
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,18 @@ on:
1414

1515
jobs:
1616
tests:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1818

19-
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
19+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, Node ${{ matrix.node }}"
2020

2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
php: ["8.1"]
25-
symfony: ["^5.4", "^6.0"]
26-
sylius: ["~1.11.0", "~1.12.0", "1.13.x-dev as 1.13.0"]
27-
node: ["14.x"]
28-
mysql: ["8.0.36"]
29-
30-
exclude:
31-
- sylius: ~1.11.0
32-
symfony: "^6.0"
24+
php: [ "8.1", "8.2", "8.3" ]
25+
symfony: [ "^5.4", "^6.0" ]
26+
sylius: [ "^1.12", "^1.13" ]
27+
node: [ "18.x", "20.x" ]
28+
mysql: [ "5.7", "8.0" ]
3329
env:
3430
APP_ENV: test
3531
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
@@ -139,11 +135,6 @@ jobs:
139135
restore-keys: |
140136
${{ runner.os }}-node-${{ matrix.node }}-yarn-
141137
142-
-
143-
name: Copy package.json.dist to package.json
144-
if: matrix.sylius != ''
145-
run: (cd tests/Application && cp "package.json.${{ matrix.sylius }}.dist" package.json)
146-
147138
-
148139
name: Install JS dependencies
149140
run: (cd tests/Application && yarn install)
@@ -170,7 +161,6 @@ jobs:
170161

171162
-
172163
name: Validate composer.json
173-
if: ${{ matrix.sylius != '1.13.x-dev as 1.13.0' }}
174164
run: composer validate --ansi --strict
175165

176166
-
@@ -186,12 +176,10 @@ jobs:
186176

187177
-
188178
name: Run Behat
189-
if: ${{ matrix.sylius != '1.13.x-dev as 1.13.0' }}
190179
run: vendor/bin/behat --colors --strict -vvv --no-interaction --tags '~@sylius113' || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun --tags '~@sylius113'
191180

192181
-
193182
name: Run Behat
194-
if: ${{ matrix.sylius == '1.13.x-dev as 1.13.0' }}
195183
run: vendor/bin/behat --colors --strict -vvv --no-interaction --tags '~@sylius112' || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun --tags '~@sylius112'
196184

197185

composer.json

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
"require": {
77
"ext-json": "*",
88
"php": "^8.0",
9-
"sylius/sylius": "~1.11.0 || >=1.12.13 || ~1.13.0",
109
"friendsofsymfony/elastica-bundle": "^6.0",
10+
"sylius/sylius": ">=1.12.13 || ~1.13.0",
1111
"symfony/property-access": "^5.4 || ^6.0",
12-
"symfony/webpack-encore-bundle": "^1.16",
12+
"symfony/webpack-encore-bundle": "^1.15",
1313
"symfony/proxy-manager-bridge": "^5.4 || ^6.0"
1414
},
1515
"require-dev": {
16-
"behat/behat": "^3.7",
17-
"behat/mink-selenium2-driver": "~1.6.0",
16+
"behat/behat": "^3.6.1",
17+
"behat/mink-selenium2-driver": "^1.4",
18+
"bitbag/coding-standard": "^v2.0",
19+
"dbrekelmans/bdi": "^1.1",
1820
"dmore/behat-chrome-extension": "^1.3",
1921
"dmore/chrome-mink-driver": "^2.7",
2022
"friends-of-behat/mink": "^1.8",
@@ -25,32 +27,46 @@
2527
"friends-of-behat/suite-settings-extension": "^1.0",
2628
"friends-of-behat/symfony-extension": "^2.1",
2729
"friends-of-behat/variadic-extension": "^1.3",
28-
"phpspec/phpspec": "^7.0",
30+
"league/flysystem-bundle": "2.4.0",
31+
"lchrusciel/api-test-case": "^5.2",
32+
"phpspec/phpspec": "^7.2",
2933
"phpstan/extension-installer": "^1.0",
30-
"phpstan/phpstan": "0.12.82",
31-
"phpstan/phpstan-doctrine": "0.12.33",
32-
"phpstan/phpstan-strict-rules": "^0.12.0",
33-
"phpstan/phpstan-webmozart-assert": "0.12.12",
34-
"phpunit/phpunit": "^9.5",
35-
"sylius-labs/coding-standard": "^4.0",
34+
"phpstan/phpstan": "^1.8.1",
35+
"phpstan/phpstan-doctrine": "1.3.69",
36+
"phpstan/phpstan-strict-rules": "^1.3.0",
37+
"phpstan/phpstan-webmozart-assert": "^1.2.0",
38+
"phpunit/phpunit": "^10.5",
39+
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
40+
"robertfausk/behat-panther-extension": "^1.1",
41+
"sylius-labs/coding-standard": "^4.2",
42+
"sylius-labs/suite-tags-extension": "^0.2",
3643
"symfony/browser-kit": "^5.4 || ^6.0",
3744
"symfony/debug-bundle": "^5.4 || ^6.0",
3845
"symfony/dotenv": "^5.4 || ^6.0",
3946
"symfony/intl": "^5.4 || ^6.0",
40-
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
41-
"vimeo/psalm": "4.27.0",
42-
"bitbag/coding-standard": "^1.0.1",
43-
"league/flysystem-bundle": "2.4.0",
44-
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
45-
"lchrusciel/api-test-case": "^5.2",
46-
"symfony/mailer": "^5.4 || ^6.0",
47-
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
48-
"twig/extra-bundle": "^3.4"
47+
"symfony/web-profiler-bundle": "^5.4 || ^6.0"
4948
},
5049
"conflict": {
51-
"symfony/form": "4.4.11 || 4.4.12",
5250
"api-platform/core": "v2.7.17",
53-
"sylius/sylius": ">= 1.12.0 < 1.12.13"
51+
"symfony/framework-bundle": "6.2.8",
52+
"behat/mink-selenium2-driver": ">=1.7.0"
53+
},
54+
"config": {
55+
"sort-packages": true,
56+
"allow-plugins": {
57+
"symfony/thanks": true,
58+
"composer/package-versions-deprecated": true,
59+
"dealerdirect/phpcodesniffer-composer-installer": true,
60+
"phpstan/extension-installer": true
61+
}
62+
},
63+
"extra": {
64+
"branch-alias": {
65+
"dev-master": "1.13-dev"
66+
},
67+
"symfony": {
68+
"require": "^5.4 || ^6.0"
69+
}
5470
},
5571
"autoload": {
5672
"psr-4": {
@@ -75,14 +91,11 @@
7591
],
7692
"post-create-project-cmd": [
7793
"php bin/create_node_symlink.php"
78-
]
79-
},
80-
"config": {
81-
"allow-plugins": {
82-
"symfony/thanks": true,
83-
"composer/package-versions-deprecated": true,
84-
"dealerdirect/phpcodesniffer-composer-installer": true,
85-
"phpstan/extension-installer": true
94+
],
95+
"auto-scripts": {
96+
"cache:clear": "symfony-cmd",
97+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
98+
"security-checker security:check": "script"
8699
}
87100
}
88101
}

ecs.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
declare(strict_types=1);
44

5-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6-
use Symplify\EasyCodingStandard\ValueObject\Option;
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
76

8-
return static function (ContainerConfigurator $containerConfigurator): void {
9-
$containerConfigurator->import('vendor/bitbag/coding-standard/ecs.php');
7+
return static function (ECSConfig $config): void {
108

11-
$parameters = $containerConfigurator->parameters();
12-
$parameters->set(Option::PATHS, [
13-
__DIR__ . '/src',
14-
__DIR__ . '/tests',
15-
]);
9+
putenv('ALLOW_BITBAG_OS_HEADER=1');
10+
11+
$config->import('vendor/bitbag/coding-standard/ecs.php');
12+
$config->paths(['src', 'tests']);
1613
};

features/shop/site_wide_searching_products.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ Feature: Site-wide products search
1111
And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV"
1212
And the store has a select product attribute "Motorbike Type" with values "Enduro" and "Naked"
1313
And there is a product named "BMW Z4" in the store
14-
And this product's price is "$42670"
14+
And this product's price is "$42,670.00"
1515
And this product has select attribute "Car Type" with value "Cabrio"
1616
And this product has a text attribute "Color" with value "Red"
1717
And this product has option "Supply" with values "Gasoline" and "Diesel"
18-
And this product is available in "Gasoline" supply priced at "$42670"
19-
And this product is available in "Diesel" supply priced at "$45670"
18+
And this product is available in "Gasoline" supply priced at "$42,670.00"
19+
And this product is available in "Diesel" supply priced at "$45,670.00"
2020
And this product belongs to "Cars"
2121
And there is a product named "Volvo XC90" in the store
22-
And this product's price is "$64505.80"
22+
And this product's price is "$64,505.80"
2323
And this product has select attribute "Car Type" with value "SUV"
2424
And this product has a text attribute "Color" with value "Black"
2525
And this product belongs to "Cars"
2626
And there is a product named "BMW 5 Series" in the store
27-
And this product's price is "$52070"
27+
And this product's price is "$52,070.00"
2828
And this product has select attribute "Car Type" with value "Cabrio"
2929
And this product has a text attribute "Color" with value "Red"
3030
And this product belongs to "Cars"
3131
And there is a product named "Lamborghini Aventador" in the store
32-
And this product's price is "$450000"
32+
And this product's price is "$450,000.00"
3333
And this product has a text attribute "Color" with value "Yellow"
3434
And this product belongs to "Cars"
3535
And there is a product named "BMW GS" in the store
36-
And this product's price is "$18070"
36+
And this product's price is "$18,070.00"
3737
And this product has select attribute "Motorbike Type" with value "Enduro"
3838
And this product has a text attribute "Color" with value "Grey"
3939
And this product belongs to "Motorbikes"
4040
And there is a product named "Ducati Monster" in the store
41-
And this product's price is "$14995"
41+
And this product's price is "$14,995.00"
4242
And this product has select attribute "Motorbike Type" with value "Naked"
4343
And this product has a text attribute "Color" with value "Black"
4444
And this product's short description is:
@@ -49,7 +49,7 @@ Feature: Site-wide products search
4949
And there is a product named "Honda Africa Twin" in the store
5050
And this product has select attribute "Motorbike Type" with value "Enduro"
5151
And this product has a text attribute "Color" with value "Green & White"
52-
And this product's price is "$13490"
52+
And this product's price is "$13,490.00"
5353
And this product's description is:
5454
"""
5555
This is the Honda Africa Twin which is like the BMW GS but from Honda.

spec/Controller/Action/Shop/ListProductsActionSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function it_renders_product_list(
7070
): void {
7171
$form->getData()->willReturn([]);
7272
$form->isValid()->willReturn(true);
73+
$form->isSubmitted()->willReturn(true);
7374
$form->handleRequest($request)->willReturn($form);
7475
$form->createView()->willReturn($formView);
7576

src/Controller/RequestDataHandler/PaginationDataHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function retrieveData(array $requestData): array
3131
return $data;
3232
}
3333

34-
private function resolvePage(array $requestData, array & $data): void
34+
private function resolvePage(array $requestData, array &$data): void
3535
{
3636
$page = 1;
3737

@@ -42,7 +42,7 @@ private function resolvePage(array $requestData, array & $data): void
4242
$data[self::PAGE_INDEX] = $page;
4343
}
4444

45-
private function resolveLimit(array $requestData, array & $data): void
45+
private function resolveLimit(array $requestData, array &$data): void
4646
{
4747
$limit = $this->defaultLimit;
4848

src/Controller/RequestDataHandler/ShopProductListDataHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function retrieveData(array $requestData): array
7171

7272
private function handleOptionsPrefixedProperty(
7373
array $requestData,
74-
array & $data
74+
array &$data
7575
): void {
7676
if (!isset($requestData['options'])) {
7777
return;
@@ -88,7 +88,7 @@ private function handleOptionsPrefixedProperty(
8888

8989
private function handleAttributesPrefixedProperty(
9090
array $requestData,
91-
array & $data,
91+
array &$data,
9292
?array $attributesDefinitions = []
9393
): void {
9494
if (!isset($requestData['attributes'])) {

src/Model/SearchFacets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __set(string $facetId, $selectedBuckets)
3434

3535
public function __isset(string $facetId)
3636
{
37-
return isset($this->selectedBuckets[$facetId]);
37+
return true;
3838
}
3939

4040
/**

src/Resources/config/services/transformer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<service id="BitBag\SyliusElasticsearchPlugin\Transformer\Product\ChannelPricingTransformer">
66
<argument type="service" id="sylius.context.channel" />
77
<argument type="service" id="sylius.context.locale" />
8-
<argument type="service" id="sylius.product_variant_resolver.default" />
8+
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
99
<argument type="service" id="sylius.money_formatter" />
1010
</service>
1111

tests/Application/config/packages/security.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ security:
4545
stateless: true
4646
entry_point: jwt
4747
json_login:
48-
check_path: "%sylius.security.new_api_admin_route%/authentication-token"
48+
check_path: "%sylius.security.new_api_admin_route%/administrators/token"
4949
username_path: email
5050
password_path: password
5151
success_handler: lexik_jwt_authentication.handler.authentication_success
@@ -58,7 +58,7 @@ security:
5858
stateless: true
5959
entry_point: jwt
6060
json_login:
61-
check_path: "%sylius.security.new_api_shop_route%/authentication-token"
61+
check_path: "%sylius.security.new_api_shop_route%/customers/token"
6262
username_path: email
6363
password_path: password
6464
success_handler: lexik_jwt_authentication.handler.authentication_success
@@ -116,9 +116,9 @@ security:
116116
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
117117
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }
118118

119-
- { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS }
119+
- { path: "%sylius.security.new_api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS }
120120
- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
121-
- { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS }
121+
- { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS }
122122
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
123-
- { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS }
123+
- { path: "%sylius.security.new_api_shop_route%/customers/token", role: PUBLIC_ACCESS }
124124
- { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS }

0 commit comments

Comments
 (0)