Skip to content

Commit 87d7133

Browse files
authored
Merge branch '2.0' into UC-30-fix-cookie
2 parents d9ffadf + 3251f5e commit 87d7133

60 files changed

Lines changed: 564 additions & 836 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,43 @@ on:
99
cron: "0 1 * * 6" # Run at 1am every Saturday
1010
workflow_dispatch: ~
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
tests:
1418
runs-on: ubuntu-latest
1519

16-
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"
20+
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine Adapter ${{ matrix.state_machine_adapter }}"
1721

1822
strategy:
1923
fail-fast: false
2024
matrix:
21-
php: ["8.1", "8.2", "8.3"]
22-
sylius: ["~1.13.0", "~1.14.0"]
23-
symfony: ["^5.4", "^6.4"]
24-
node: ["20.x"]
25+
php: ["8.2", "8.3", "8.4"]
26+
sylius: ["~2.0.0", "~2.1.0"]
27+
symfony: ["^6.4", "^7.0"]
28+
node: ["22.x"]
2529
mysql: ["8.0"]
30+
state_machine_adapter: [ "symfony_workflow" ]
31+
32+
include:
33+
- php: "8.3"
34+
symfony: "^6.4"
35+
sylius: "~2.1.0"
36+
node: "22.x"
37+
database: "mysql"
38+
mysql: "8.0"
39+
state_machine_adapter: "winzou_state_machine"
2640

2741
env:
2842
APP_ENV: test
2943
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
44+
TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"
3045

3146
steps:
3247
-
33-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
3449

3550
-
3651
name: Setup PHP
@@ -161,10 +176,6 @@ jobs:
161176
name: Run PHPStan
162177
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/
163178

164-
-
165-
name: Run PHPSpec
166-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
167-
168179
-
169180
name: Run PHPUnit
170181
run: vendor/bin/phpunit --colors=always

behat.yml.dist

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ imports:
33
- tests/Behat/Resources/suites.yml
44

55
default:
6-
formatters:
7-
pretty:
8-
verbose: true
9-
paths: false
10-
snippets: false
11-
126
extensions:
137
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
14-
Robertfausk\Behat\PantherExtension: ~
158

169
FriendsOfBehat\MinkDebugExtension:
1710
directory: etc/build
@@ -22,30 +15,14 @@ default:
2215
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
2316
base_url: "https://127.0.0.1:8080/"
2417
default_session: symfony
25-
javascript_session: panther
18+
javascript_session: chrome
2619
sessions:
2720
symfony:
2821
symfony: ~
29-
chromedriver:
22+
chrome:
3023
chrome:
3124
api_url: http://127.0.0.1:9222
3225
validate_certificate: false
33-
chrome_headless_second_session:
34-
chrome:
35-
api_url: http://127.0.0.1:9222
36-
validate_certificate: false
37-
panther:
38-
panther:
39-
manager_options:
40-
connection_timeout_in_ms: 5000
41-
request_timeout_in_ms: 120000
42-
chromedriver_arguments:
43-
- --log-path=etc/build/chromedriver.log
44-
- --verbose
45-
capabilities:
46-
acceptSslCerts: true
47-
acceptInsecureCerts: true
48-
unexpectedAlertBehaviour: accept
4926
show_auto: false
5027

5128
FriendsOfBehat\SymfonyExtension:
@@ -58,5 +35,3 @@ default:
5835
FriendsOfBehat\SuiteSettingsExtension:
5936
paths:
6037
- "features"
61-
62-
SyliusLabs\SuiteTagsExtension: ~

composer.json

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,54 @@
55
"description": "Integration with User.com for Sylius.",
66
"license": "MIT",
77
"require": {
8-
"php": "^8.1",
9-
"sylius/sylius": "~1.13.0 || ~1.14.0",
10-
"symfony/amqp-messenger": "^5.4 || ^6.4 || ^7.0",
11-
"symfony/messenger": "^5.4 || ^6.4",
12-
"symfony/webpack-encore-bundle": "^1.15"
8+
"php": "^8.2",
9+
"sylius/sylius": "^2.0",
10+
"symfony/amqp-messenger": "^6.4 || ^7.0",
11+
"symfony/messenger": "^6.4 || ^7.0"
1312
},
1413
"require-dev": {
15-
"behat/behat": "^3.6.1",
16-
"behat/mink-selenium2-driver": "^1.4",
17-
"bitbag/coding-standard": "^3.0",
18-
"dbrekelmans/bdi": "^1.1",
19-
"dmore/behat-chrome-extension": "^1.3",
20-
"dmore/chrome-mink-driver": "^2.7",
21-
"friends-of-behat/mink": "^1.8",
22-
"friends-of-behat/mink-browserkit-driver": "^1.4",
23-
"friends-of-behat/mink-debug-extension": "^2.0.0",
24-
"friends-of-behat/mink-extension": "^2.4",
14+
"behat/behat": "^3.16",
15+
"dbrekelmans/bdi": "^1.4",
16+
"dmore/behat-chrome-extension": "^1.4",
17+
"dmore/chrome-mink-driver": "^2.9",
18+
"friends-of-behat/mink": "^1.11",
19+
"friends-of-behat/mink-browserkit-driver": "^1.6",
20+
"friends-of-behat/mink-debug-extension": "^2.1",
21+
"friends-of-behat/mink-extension": "^2.7",
2522
"friends-of-behat/page-object-extension": "^0.3",
26-
"friends-of-behat/suite-settings-extension": "^1.0",
27-
"friends-of-behat/symfony-extension": "^2.1",
28-
"friends-of-behat/variadic-extension": "^1.3",
29-
"phpspec/phpspec": "^7.2",
30-
"phpstan/extension-installer": "^1.0",
31-
"phpstan/phpstan": "^1.8.1",
32-
"phpstan/phpstan-doctrine": "1.3.69",
33-
"phpstan/phpstan-strict-rules": "^1.3.0",
34-
"phpstan/phpstan-webmozart-assert": "^1.2.0",
23+
"friends-of-behat/suite-settings-extension": "^1.1",
24+
"friends-of-behat/symfony-extension": "^2.6",
25+
"friends-of-behat/variadic-extension": "^1.6",
26+
"nyholm/psr7": "^1.8",
27+
"phpstan/phpstan": "^1.12",
28+
"phpstan/phpstan-doctrine": "^1.3",
29+
"phpstan/phpstan-webmozart-assert": "^1.2",
3530
"phpunit/phpunit": "^10.5",
36-
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
3731
"robertfausk/behat-panther-extension": "^1.1",
38-
"sylius-labs/coding-standard": "^4.2",
39-
"sylius-labs/suite-tags-extension": "^0.2",
40-
"symfony/browser-kit": "^5.4 || ^6.4",
41-
"symfony/debug-bundle": "^5.4 || ^6.4",
42-
"symfony/dotenv": "^5.4 || ^6.4",
43-
"symfony/flex": "^2.4",
44-
"symfony/intl": "^5.4 || ^6.4",
45-
"symfony/web-profiler-bundle": "^5.4 || ^6.4"
46-
},
47-
"conflict": {
48-
"symfony/framework-bundle": "6.2.8"
32+
"sylius-labs/coding-standard": "^4.4",
33+
"sylius-labs/suite-tags-extension": "~0.2",
34+
"symfony/browser-kit": "^6.4 || ^7.1",
35+
"symfony/debug-bundle": "^6.4 || ^7.1",
36+
"symfony/dotenv": "^6.4 || ^7.1",
37+
"symfony/http-client": "^6.4 || ^7.1",
38+
"symfony/intl": "^6.4 || ^7.1",
39+
"symfony/runtime": "^6.4 || ^7.1",
40+
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
41+
"symfony/webpack-encore-bundle": "^2.2"
4942
},
5043
"config": {
5144
"sort-packages": true,
5245
"allow-plugins": {
5346
"dealerdirect/phpcodesniffer-composer-installer": false,
47+
"php-http/discovery": false,
5448
"phpstan/extension-installer": true,
55-
"symfony/flex": true
49+
"symfony/flex": true,
50+
"symfony/runtime": true
5651
}
5752
},
5853
"extra": {
5954
"symfony": {
60-
"require": "^5.4 || ^6.4"
55+
"require": "^6.4"
6156
}
6257
},
6358
"autoload": {
@@ -77,19 +72,17 @@
7772
]
7873
},
7974
"scripts": {
80-
"post-install-cmd": [
81-
"php bin/create_node_symlink.php"
82-
],
83-
"post-update-cmd": [
84-
"php bin/create_node_symlink.php"
75+
"analyse": [
76+
"@composer validate --strict",
77+
"vendor/bin/phpstan analyse -c phpstan.neon -l max src/",
78+
"vendor/bin/ecs check src/ spec/"
8579
],
86-
"post-create-project-cmd": [
87-
"php bin/create_node_symlink.php"
80+
"fix": [
81+
"vendor/bin/ecs check src/ --fix"
8882
],
8983
"auto-scripts": {
9084
"cache:clear": "symfony-cmd",
91-
"assets:install %PUBLIC_DIR%": "symfony-cmd",
92-
"security-checker security:check": "script"
85+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
9386
}
9487
}
9588
}

config/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
imports:
2+
- { resource: "@BitBagSyliusUserComPlugin/config/twig_hooks/**/*.yaml" }
3+
- { resource: "@BitBagSyliusUserComPlugin/config/monolog.yaml" }
4+
- { resource: "@BitBagSyliusUserComPlugin/config/packages/*" }
5+
- { resource: "@BitBagSyliusUserComPlugin/config/winzou_state_machine.php" }
6+
17
parameters:
28
user_com.frontend_api_key: '%env(USER_COM_FRONTEND_API_KEY)%'
39
user_com.encryption_key: '%env(USER_COM_ENCRYPTION_KEY)%'
@@ -7,9 +13,3 @@ parameters:
713
twig:
814
globals:
915
user_com_frontend_api_key: '%user_com.frontend_api_key%'
10-
11-
imports:
12-
- { resource: "state_machine/*" }
13-
- { resource: "events.yaml" }
14-
- { resource: "monolog.yaml" }
15-
- { resource: "packages/*" }

config/events.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
44
<imports>
5-
<import resource="services/*"/>
5+
<import resource="services/**/*.xml" />
66
</imports>
77
</container>

config/services/workflow/order.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
4+
<services>
5+
<service
6+
id="sylius_user_com_plugin.listener.workflow.order.order_user_com_update"
7+
class="BitBag\SyliusUserComPlugin\EventListener\Workflow\Order\OrderCompleteListener"
8+
>
9+
<argument type="service" id="messenger.default_bus"/>
10+
<argument type="service" id="monolog.logger.user_com"/>
11+
<tag name="kernel.event_listener" event="workflow.sylius_order.completed.create" priority="100" />
12+
<tag name="kernel.event_listener" event="workflow.sylius_order.completed.cancel" priority="100" />
13+
<tag name="kernel.event_listener" event="workflow.sylius_order.completed.fulfill" priority="100" />
14+
</service>
15+
16+
</services>
17+
</container>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sylius_twig_hooks:
2+
hooks:
3+
'sylius_admin.channel.update.content.form.sections.general':
4+
user_com_configuration:
5+
template: '@BitBagSyliusUserComPlugin/UserApiResource/_userComCredentials.html.twig'
6+
priority: 450
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sylius_twig_hooks:
2+
hooks:
3+
'sylius_admin.channel.update.content.form.sections.general':
4+
user_com_configuration:
5+
template: '@BitBagSyliusUserComPlugin/UserApiResource/_userComCredentials.html.twig'
6+
priority: 450

config/twig_hooks/shop/base.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sylius_twig_hooks:
2+
hooks:
3+
'sylius_shop.base#stylesheets':
4+
user_com_scripts:
5+
template: '@BitBagSyliusUserComPlugin/Scripts/_userComScripts.html.twig'
6+
priority: -100
7+
8+
'sylius_shop.base.header':
9+
user_com_gtm:
10+
template: '@BitBagSyliusUserComPlugin/Scripts/_userComGTM.html.twig'
11+
priority: -100

0 commit comments

Comments
 (0)