Skip to content

Commit

Permalink
Added posibility to use sylius 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
leszczuu committed Mar 14, 2024
1 parent 916f6ab commit 956c26b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 21 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ["8.0"]
php: ["8.1"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.0", "~1.12.0"]
sylius: ["~1.11.0", "~1.12.0", "1.13.x-dev as 1.13.0"]
node: ["14.x"]
mysql: ["8.0"]

Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
-
name: Copy package.json.dist to package.json
if: matrix.sylius != ''
run: (cd tests/Application && cp package.json.\${{ matrix.sylius }}.dist package.json)
run: (cd tests/Application && cp "package.json.${{ matrix.sylius }}.dist" package.json)

-
name: Install JS dependencies
Expand All @@ -167,10 +167,10 @@ 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
# Temp commented out, needs to be enabled again when 1.13.x-dev is officialy released
# -
# name: Validate composer.json
# run: composer validate --ansi --strict

-
name: Validate database schema
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"ext-json": "*",
"php": "^8.0",
"sylius/sylius": "~1.11.0 || ~1.12.0",
"sylius/sylius": "~1.11.0 || ~1.12.0 || ~1.13.0",
"friendsofsymfony/elastica-bundle": "^6.0",
"symfony/property-access": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.16",
Expand Down
16 changes: 8 additions & 8 deletions features/shop/site_wide_searching_products.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ Feature: Site-wide products search
And the store has a select product attribute "Car Type" with values "Cabrio" and "SUV"
And the store has a select product attribute "Motorbike Type" with values "Enduro" and "Naked"
And there is a product named "BMW Z4" in the store
And this product's price is "$42670"
And this product's price is "$42670.00"
And this product has select attribute "Car Type" with value "Cabrio"
And this product has a text attribute "Color" with value "Red"
And this product has option "Supply" with values "Gasoline" and "Diesel"
And this product is available in "Gasoline" supply priced at "$42670"
And this product is available in "Diesel" supply priced at "$45670"
And this product is available in "Gasoline" supply priced at "$42670.00"
And this product is available in "Diesel" supply priced at "$45670.00"
And this product belongs to "Cars"
And there is a product named "Volvo XC90" in the store
And this product's price is "$64505.80"
And this product has select attribute "Car Type" with value "SUV"
And this product has a text attribute "Color" with value "Black"
And this product belongs to "Cars"
And there is a product named "BMW 5 Series" in the store
And this product's price is "$52070"
And this product's price is "$52070.00"
And this product has select attribute "Car Type" with value "Cabrio"
And this product has a text attribute "Color" with value "Red"
And this product belongs to "Cars"
And there is a product named "Lamborghini Aventador" in the store
And this product's price is "$450000"
And this product's price is "$450000.00"
And this product has a text attribute "Color" with value "Yellow"
And this product belongs to "Cars"
And there is a product named "BMW GS" in the store
And this product's price is "$18070"
And this product's price is "$18070.00"
And this product has select attribute "Motorbike Type" with value "Enduro"
And this product has a text attribute "Color" with value "Grey"
And this product belongs to "Motorbikes"
And there is a product named "Ducati Monster" in the store
And this product's price is "$14995"
And this product's price is "$14995.00"
And this product has select attribute "Motorbike Type" with value "Naked"
And this product has a text attribute "Color" with value "Black"
And this product's short description is:
Expand All @@ -49,7 +49,7 @@ Feature: Site-wide products search
And there is a product named "Honda Africa Twin" in the store
And this product has select attribute "Motorbike Type" with value "Enduro"
And this product has a text attribute "Color" with value "Green & White"
And this product's price is "$13490"
And this product's price is "$13490.00"
And this product's description is:
"""
This is the Honda Africa Twin which is like the BMW GS but from Honda.
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/RequestDataHandler/PaginationDataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function retrieveData(array $requestData): array
return $data;
}

private function resolvePage(array $requestData, array &$data): void
private function resolvePage(array $requestData, array & $data): void
{
$page = 1;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function retrieveData(array $requestData): array

private function handleOptionsPrefixedProperty(
array $requestData,
array &$data
array & $data
): void {
if (!isset($requestData['options'])) {
return;
Expand All @@ -88,7 +88,7 @@ private function handleOptionsPrefixedProperty(

private function handleAttributesPrefixedProperty(
array $requestData,
array &$data,
array & $data,
?array $attributesDefinitions = []
): void {
if (!isset($requestData['attributes'])) {
Expand Down
11 changes: 10 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

return [
use Sylius\Bundle\CoreBundle\SyliusCoreBundle;

$bundles = [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Expand Down Expand Up @@ -63,3 +65,10 @@
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
];


if ( defined(SyliusCoreBundle::class.'::VERSION_ID') && SyliusCoreBundle::VERSION_ID >= '11300') {
$bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true];
}

return $bundles;
41 changes: 41 additions & 0 deletions tests/Application/package.json.1.13.x-dev as 1.13.0.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"dependencies": {
"@babel/polyfill": "^7.0.0",
"chart.js": "^3.7.1",
"jquery": "^3.5.0",
"jquery.dirtyforms": "^2.0.0",
"lightbox2": "^2.9.0",
"semantic-ui-css": "^2.2.0",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"@symfony/webpack-encore": "^1.6.1",
"babel-core": "^6.26.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"dedent": "^0.7.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-plugin-import": "^2.11.0",
"merge-stream": "^1.0.0",
"sass": "^1.39.2",
"sass-loader": "^12.1.0"
},
"scripts": {
"dev": "yarn encore dev",
"watch": "yarn encore dev --watch",
"prod": "yarn encore prod",
"lint": "yarn lint:js",
"lint:js": "eslint gulpfile.babel.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Sylius/Sylius.git"
},
"author": "Paweł Jędrzejewski",
"license": "MIT"
}

0 comments on commit 956c26b

Please sign in to comment.