Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin to sylius 1.13. #424

Merged
merged 19 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
df04176
Sylius 1.13 - Update composer.json
BartoszWojdalowicz Feb 26, 2024
368352e
Sylius 1.13 - Add workflow configuration
BartoszWojdalowicz Feb 26, 2024
6def59f
Sylius 1.13 - Remove deprecation
BartoszWojdalowicz Feb 26, 2024
1f0cf1d
Sylius 1.13 - Update gh actions config
BartoszWojdalowicz Feb 26, 2024
338cbe2
Sylius 1.13 - Update bundles.php in test application
BartoszWojdalowicz Feb 26, 2024
ec10dee
Sylius 1.13 - Update bundles.php in test application
BartoszWojdalowicz Feb 26, 2024
a4318d6
Sylius 1.13 - add workflow configuration only in 1.13, add workflow t…
BartoszWojdalowicz Feb 27, 2024
e6b3dc0
Sylius 1.13 - add mailer configuration to the 1.13 version
BartoszWojdalowicz Feb 27, 2024
68d7897
Sylius 1.13 - add mailer configuration in the global config of test app
BartoszWojdalowicz Feb 27, 2024
e9de629
Sylius 1.13 - adapt state machine configuration per version
BartoszWojdalowicz Feb 27, 2024
9d43c5b
Sylius 1.13 - fix composer.json problem
BartoszWojdalowicz Feb 27, 2024
1e379fc
Sylius 1.13 - try to fix problem with not existing service
BartoszWojdalowicz Feb 27, 2024
bcccd21
Sylius 1.13 - unlock sylius 13 version in gh actions
BartoszWojdalowicz Feb 27, 2024
c566a98
Sylius 1.13 - fix behats scenarios
BartoszWojdalowicz Feb 27, 2024
8ace323
Sylius 1.13 - Add info about state machine adapter in gh actions
BartoszWojdalowicz Feb 28, 2024
0a57109
Sylius 1.13 - Add missing info about symfony workflow in readme
BartoszWojdalowicz Feb 28, 2024
50db970
Sylius 1.13 - Fix duplicated configuration key
BartoszWojdalowicz Feb 28, 2024
c3cf08a
[Maintenance] Slight fixes of 1.13 support
NoResponseMate Mar 1, 2024
95884bb
[Maintenance] Update builds
NoResponseMate Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ jobs:
tests:
runs-on: ubuntu-latest

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}"
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}"

strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.4", "~1.12.0"]
php: ["8.1", "8.2", "8.3"]
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
symfony: ["^5.4.21", "^6.4"]
sylius: ["~1.12.0", "~1.13.x-dev",]
node: ["16.x"]
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
mysql: ["5.7", "8.0"]
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
wkhtmltopdf: ["0.12.6-1"]
state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ]

NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved

include:
-
Expand All @@ -38,25 +40,15 @@ jobs:
node: "16.x"
mysql: "8.0"
wkhtmltopdf: false
-
php: "8.1"
symfony: "^5.4"
sylius: "~1.11.2"
node: "14.x"
mysql: "8.0"
wkhtmltopdf: false

exclude:
-
php: "8.0"
symfony: "^6.0"
-
symfony: "^6.0"
sylius: "~1.11.4"
sylius: "~1.12.0"
state_machine_adapter: "symfony_workflow"

env:
APP_ENV: test
DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}"
TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"

steps:
-
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ From Administrator's point of view, every Refund request results in creating two
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf # Change this! :)
```

1. If you are using the symfony workflows instead winzou_state_machine please import configuration:
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved

```yaml
imports:
- { resource: "@SyliusRefundPlugin/Resources/config/app/workflow.yaml" }
```

#### Beware!

This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,41 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"knplabs/knp-snappy-bundle": "^1.7",
"myclabs/php-enum": "^1.7",
"php-http/message-factory": "^1.1",
"sylius/resource-bundle": "^1.6",
"sylius/sylius": "~1.11.4 || ~1.12.0",
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
"symfony/messenger": "^5.4 || ^6.0"
"sylius/resource-bundle": "^1.9",
"sylius/sylius": "~1.12.0 || ~1.13.x-dev",
"symfony/messenger": "^5.4.21 || ^6.4"
},
"require-dev": {
"behat/behat": "^3.6",
"behat/behat": "^3.6.1",
"behat/mink-selenium2-driver": "^1.4",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"friends-of-behat/exclude-specifications-extension": "^0.2 || ^0.3",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.3",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0",
"friends-of-behat/mink-extension": "^2.3",
"friends-of-behat/mink-extension": "^2.4",
"friends-of-behat/page-object-extension": "^0.3",
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"phpspec/phpspec": "^7.0",
"phpstan/phpstan": "1.5.4",
"phpstan/phpstan-webmozart-assert": "1.1.2",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"phpspec/phpspec": "^7.2",
"phpstan/phpstan": "^1.6",
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpunit/phpunit": "^9.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"sylius-labs/coding-standard": "~4.3.0",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"sylius-labs/coding-standard": "^4.2",
"symfony/browser-kit": "^5.4.21 || ^6.4",
"symfony/debug-bundle": "^5.4.21 || ^6.4",
"symfony/dotenv": "^5.4.21 || ^6.4",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4.21 || ^6.4",
"symfony/webpack-encore-bundle": "^1.15"
},
"conflict": {
Expand Down
2 changes: 1 addition & 1 deletion features/filtering_credit_memos.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Filtering credit memos
And the store has a zone "United States + United Kingdom" with code "US + UK"
And this zone has the "United States" country member
And this zone has the "United Kingdom" country member
And the store has a product "Mr. Meeseeks T-Shirt" priced at "$10" available in channel "Web-US" and channel "Web-UK"
And the store has a product "Mr. Meeseeks T-Shirt" priced at "$10.00" available in channel "Web-US" and channel "Web-UK"
And the store ships everywhere for free for all channels
And the store allows paying offline for all channels
And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000001"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Refunding a single order unit with promotion applied
And the store allows shipping with "Galaxy Post"
And the store allows paying with "Space money"
And there is a promotion "Anatomy Park Promotion"
And this promotion gives "$1" off on every product with minimum price at "$5.00"
And this promotion gives "$1.00" off on every product with minimum price at "$5.00"
And there is a customer "rick.sanchez@wubba-lubba-dub-dub.com" that placed an order "#00000022"
And the customer bought 2 "Mr. Meeseeks T-Shirt" products
And the customer chose "Galaxy Post" shipping method to "United States" with "Space money" payment
Expand Down
17 changes: 17 additions & 0 deletions src/Resources/config/app/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
framework:
workflows:
sylius_refund_refund_payment:
type: state_machine
marking_store:
type: method
property: state
supports:
- Sylius\RefundPlugin\Entity\RefundPayment
initial_marking: new
places:
- !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_NEW
- !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_COMPLETED
transitions:
complete:
from: !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_NEW
to: !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_COMPLETED
4 changes: 4 additions & 0 deletions tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@
$bundles[Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class] = ['all' => true];
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
}

if (SyliusKernel::MINOR_VERSION == 13) {
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
$bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true];
}

return $bundles;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
framework:
mailer:
dsn: 'null://null'
cache:
pools:
test.mailer_pool:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions tests/Application/config/sylius/1.12/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
test_default_state_machine_adapter: 'winzou_state_machine'
test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%'
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions tests/Application/config/sylius/1.13/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
test_default_state_machine_adapter: 'symfony_workflow'
test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%'


NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
sylius_state_machine_abstraction:
graphs_to_adapters_mapping:
sylius_refund_refund_payment: '%test_sylius_state_machine_adapter%'
21 changes: 21 additions & 0 deletions tests/Application/config/sylius/1.13/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
framework:
workflows:
sylius_refund_refund_payment:
type: state_machine
marking_store:
type: method
property: state
supports:
- Sylius\RefundPlugin\Entity\RefundPayment
initial_marking: new
places:
- !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_NEW
- !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_COMPLETED
transitions:
complete:
from: !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_NEW
to: !php/const Sylius\RefundPlugin\Entity\RefundPaymentInterface::STATE_COMPLETED

sylius_state_machine_abstraction:
graphs_to_adapters_mapping:
sylius_refund_refund_payment: symfony_workflow
NoResponseMate marked this conversation as resolved.
Show resolved Hide resolved
Loading