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

Support for Sylius 1.13 #203

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 9 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]
symfony: ["^5.4", "^6.4"]
sylius: ["^1.12.13"]
sylius: ["1.12.16", "1.13.1"]
node: ["18.x"]
mysql: ["8.0"]

exclude:
-
php: "8.0"
symfony: "^6.4"

env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
Expand All @@ -51,7 +46,7 @@ jobs:

-
name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ matrix.node }}"

Expand Down Expand Up @@ -82,14 +77,18 @@ jobs:
name: Run webserver
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)

-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

-
name: Cache Composer
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
Expand Down Expand Up @@ -126,7 +125,7 @@ jobs:

-
name: Cache Yarn
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
Expand Down Expand Up @@ -158,10 +157,6 @@ jobs:
name: Load fixtures in test application
run: (cd tests/Application && bin/console sylius:fixtures:load -n)

-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)
Expand Down
45 changes: 26 additions & 19 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ imports:
- tests/Behat/Resources/suites.yml

default:
formatters:
pretty:
verbose: true
paths: false
snippets: false

gherkin:
filters:
tags: "~@todo"
extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Robertfausk\Behat\PantherExtension: ~

FriendsOfBehat\MinkDebugExtension:
directory: etc/build
Expand All @@ -18,32 +25,30 @@ default:
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
base_url: "https://127.0.0.1:8080/"
default_session: symfony
javascript_session: chrome_headless
javascript_session: panther
sessions:
symfony:
symfony: ~
chrome_headless:
chromedriver:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
chrome:
selenium2:
browser: chrome
capabilities:
browserName: chrome
browser: chrome
version: ""
marionette: null # https://github.com/Behat/MinkExtension/pull/311
chrome:
switches:
- "start-fullscreen"
- "start-maximized"
- "no-sandbox"
extra_capabilities:
chrome_headless_second_session:
chrome:
api_url: http://127.0.0.1:9222
validate_certificate: false
panther:
panther:
manager_options:
connection_timeout_in_ms: 5000
request_timeout_in_ms: 120000
chromedriver_arguments:
- --log-path=etc/build/chromedriver.log
- --verbose
capabilities:
acceptSslCerts: true
acceptInsecureCerts: true
unexpectedAlertBehaviour: accept
firefox:
selenium2:
browser: firefox
show_auto: false

FriendsOfBehat\SymfonyExtension:
Expand All @@ -56,3 +61,5 @@ default:
FriendsOfBehat\SuiteSettingsExtension:
paths:
- "features"

SyliusLabs\SuiteTagsExtension: ~
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
],
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.1",
"akeneo/api-php-client": "^11",
"cocur/slugify": "^4.0",
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/guzzle": "^6.5 || ^7.6",
"http-interop/http-factory-guzzle": "^1.0",
"php-http/guzzle6-adapter": "^2.0",
"sylius/mailer-bundle": "^1.8 || ^2.0",
"sylius/sylius": "^1.12.11",
"sylius/sylius": "^1.12.11 || ^1.13",
"symfony/deprecation-contracts": "^2.2",
"symfony/lock": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.15"
},
"require-dev": {
"ext-json": "*",
"behat/behat": "^3.14",
"behat/mink-selenium2-driver": "1.6",
"behat/mink-selenium2-driver": "^1.6",
"dbrekelmans/bdi": "^1.1",
"dmore/behat-chrome-extension": "^1.4",
"dmore/chrome-mink-driver": "^2.9",
"friends-of-behat/mink": "^1.11",
Expand All @@ -43,9 +42,11 @@
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^9.6 || ^10.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
"sylius-labs/coding-standard": "^4.3",
"sylius-labs/suite-tags-extension": "^0.2",
"symfony/browser-kit": "^5.4 || ^6.4",
"symfony/debug-bundle": "^5.4 || ^6.4",
"symfony/dotenv": "^5.4 || ^6.4",
Expand Down
4 changes: 4 additions & 0 deletions features/importing_product_models.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Feature: Importing product models
@cli
Scenario: Importing product model and its variants
Given there is an attribute "size" on Akeneo of type "pim_catalog_simpleselect"
Given there is an option "M" for attribute "size" on Akeneo
Given there is an option "L" for attribute "size" on Akeneo

And there is a family variant "accessories_size" on Akeneo for the family "accessories"
And the family variant "accessories_size" of family "accessories" has the attribute "size" as axes of first level
Expand All @@ -18,10 +20,12 @@ Feature: Importing product models

And there is a product "BRAIDED_HAT_M" on Akeneo
And the product "BRAIDED_HAT_M" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_M" has an attribute "size" with data "M"
And the product "BRAIDED_HAT_M" has a price attribute with amount "33.99" and currency "USD"

And there is a product "BRAIDED_HAT_L" on Akeneo
And the product "BRAIDED_HAT_L" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_L" has an attribute "size" with data "L"
And the product "BRAIDED_HAT_L" has a price attribute with amount "33.00" and currency "USD"

And the store is also available in "it_IT"
Expand Down
8 changes: 8 additions & 0 deletions features/importing_products.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Feature: Importing products
@cli
Scenario: Importing single product model and its variants
Given there is an attribute "size" on Akeneo of type "pim_catalog_simpleselect"
Given there is an option "M" for attribute "size" on Akeneo
Given there is an option "L" for attribute "size" on Akeneo

And there is a family variant "accessories_size" on Akeneo for the family "accessories"
And the family variant "accessories_size" of family "accessories" has the attribute "size" as axes of first level
Expand All @@ -18,10 +20,12 @@ Feature: Importing products

And there is a product "BRAIDED_HAT_M" on Akeneo
And the product "BRAIDED_HAT_M" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_M" has an attribute "size" with data "M"
And the product "BRAIDED_HAT_M" has a price attribute with amount "33.99" and currency "USD"

And there is a product "BRAIDED_HAT_L" on Akeneo
And the product "BRAIDED_HAT_L" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_L" has an attribute "size" with data "L"
And the product "BRAIDED_HAT_L" has a price attribute with amount "33.00" and currency "USD"

And the store is also available in "it_IT"
Expand All @@ -34,6 +38,8 @@ Feature: Importing products
@cli
Scenario: Importing products with images should not leave temporary files in temporary files directory
Given there is an attribute "size" on Akeneo of type "pim_catalog_simpleselect"
Given there is an option "M" for attribute "size" on Akeneo
Given there is an option "L" for attribute "size" on Akeneo
Given there is an attribute "attachment" on Akeneo of type "pim_catalog_file"

And there is a family variant "accessories_size" on Akeneo for the family "accessories"
Expand All @@ -43,12 +49,14 @@ Feature: Importing products

And there is a product "BRAIDED_HAT_M" on Akeneo
And the product "BRAIDED_HAT_M" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_M" has an attribute "size" with data "M"
And the product "BRAIDED_HAT_M" has a price attribute with amount "33.99" and currency "USD"
And the product "BRAIDED_HAT_M" has an attribute "attachment" with data "sample.pdf"
And the product "BRAIDED_HAT_M" has an attribute "image" with data "star_wars_m.jpeg"

And there is a product "BRAIDED_HAT_L" on Akeneo
And the product "BRAIDED_HAT_L" has parent "MODEL_BRAIDED_HAT"
And the product "BRAIDED_HAT_L" has an attribute "size" with data "L"
And the product "BRAIDED_HAT_L" has a price attribute with amount "33.00" and currency "USD"
And the product "BRAIDED_HAT_L" has an attribute "attachment" with data "sample.pdf"
And the product "BRAIDED_HAT_L" has an attribute "image" with data "star_wars_l.jpeg"
Expand Down
6 changes: 3 additions & 3 deletions features/reconciliate_products.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ Feature: Reconcile products
And there is a product "PRODUCT_1_VARIANT_2" updated at "2021-04-19" on Akeneo
And there is a product "PRODUCT_2_VARIANT_2" updated at "2021-04-19" on Akeneo
And the store has a product "product-1-variant-1"
And this product has "product-1-variant-2" variant priced at "$25"
And this product has "product-1-variant-2" variant priced at "$25.00"
And the store has a product "product-2-variant-1"
And this product has "product-2-variant-2" variant priced at "$25"
And this product has "product-2-variant-2" variant priced at "$25.00"
And the store has a product "product-3-variant-1"
And this product has "product-3-variant-2" variant priced at "$25"
And this product has "product-3-variant-2" variant priced at "$25.00"
When I reconcile items
Then the "product-1-variant-1" product should be enabled
And the "product-1-variant-1" product variant should be enabled
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
parameters:
level: max
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
paths:
- src
- tests/Behat
Expand All @@ -15,6 +14,10 @@ parameters:
- 'tests/Application/src/**.php'

ignoreErrors:
-
identifier: missingType.generics # Temp
-
identifier: missingType.iterableValue
- '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
- '/Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) invoked with 2 parameters, 1 required\./'
- '/Parameter \#1 \$event of method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\) expects object, string given\./'
Expand Down
Loading
Loading