Skip to content

Commit

Permalink
Merge pull request #47 from BitBagCommerce/OP-142/sylius_upgrade
Browse files Browse the repository at this point in the history
OP-142/Sylius 1.12 support
  • Loading branch information
senghe authored Apr 11, 2023
2 parents 46915d7 + 2c64176 commit 90dfc54
Show file tree
Hide file tree
Showing 52 changed files with 253 additions and 661 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ on:

jobs:
tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"

strategy:
fail-fast: false
matrix:
php: ["8.0", "7.4"]
symfony: ["^4.4", "^5.2"]
sylius: ["~1.10.0", "~1.11.0"]
php: ["8.0"]
symfony: ["^5.4", "^6.0"]
sylius: ["~1.11.0", "~1.12.0"]
node: ["^14.17.x"]
mysql: ["8.0"]
mysql: ["5.7", "8.0"]

exclude:
- sylius: ~1.11.0
php: 7.4
- # Segmentation fault while clearing cache
php: 8.0
mysql: 5.7
- sylius: ~1.11.0
symfony: ^6.0

env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"
Expand Down Expand Up @@ -97,6 +101,7 @@ jobs:
- name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
Expand Down
27 changes: 12 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0",
"sylius/sylius": "~1.9.0 || ~1.10.0 || ~1.11.0"
"php": "^8.0",
"sylius/sylius": "~1.11.0 || ~1.12.0"
},
"require-dev": {
"behat/behat": "^3.6.1",
Expand All @@ -25,7 +25,6 @@
"friends-of-behat/suite-settings-extension": "^1.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/variadic-extension": "^1.3",
"friendsofsymfony/oauth-server-bundle": "^1.6 || >2.0.0-alpha.0 ^2.0@dev",
"lchrusciel/api-test-case": "^5.2",
"phpspec/phpspec": "^7.0",
"phpstan/extension-installer": "^1.0",
Expand All @@ -34,23 +33,22 @@
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-webmozart-assert": "0.12.12",
"phpunit/phpunit": "^9.5",
"sensiolabs/security-checker": "^6.0",
"sylius-labs/coding-standard": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.2",
"symfony/debug-bundle": "^4.4 || ^5.2",
"symfony/dotenv": "^4.4 || ^5.2",
"symfony/intl": "^4.4 || ^5.2",
"symfony/web-profiler-bundle": "^4.4 || ^5.2",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symfony/webpack-encore-bundle": "^1.13",
"vimeo/psalm": "4.7.1",
"vimeo/psalm": "4.12",
"polishsymfonycommunity/symfony-mocker-container": "^1.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": false,
"phpstan/extension-installer": false,
"symfony/thanks": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true,
"symfony/thanks": false
}
},
"extra": {
Expand Down Expand Up @@ -81,7 +79,6 @@
]
},
"conflict": {
"doctrine/dbal": "^3.0",
"symfony/password-hasher": "^6.0"
"doctrine/dbal": "^3.0"
}
}
6 changes: 3 additions & 3 deletions src/Resources/config/routing/shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sylius_shop_cart_items:
path: /cart-items
methods: [GET]
defaults:
_controller: sylius.controller.order:summaryAction
_controller: sylius.controller.order::summaryAction
_sylius:
template: "@SyliusShop/Cart/Summary/_items.html.twig"
form: Sylius\Bundle\OrderBundle\Form\Type\CartType
Expand All @@ -36,15 +36,15 @@ bitbag_sylius_multi_cart_plugin_shop_cart_total:
path: /cart-total
methods: [GET]
defaults:
_controller: sylius.controller.order:summaryAction
_controller: sylius.controller.order::summaryAction
_sylius:
template: "@BitBagSyliusMultiCartPlugin/Shop/Cart/Summary/_total.html.twig"

bitbag_sylius_multi_cart_plugin_shop_cart_item:
path: /cart-item
methods: [GET]
defaults:
_controller: sylius.controller.order:summaryAction
_controller: sylius.controller.order::summaryAction
_sylius:
template: "@BitBagSyliusMultiCartPlugin/Shop/Cart/Summary/_item.html.twig"
form: Sylius\Bundle\OrderBundle\Form\Type\CartType
2 changes: 2 additions & 0 deletions tests/Application/.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ MAILER_URL=smtp://localhost
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=sync://
###< symfony/messenger ###

MAILER_DSN='null://null'
12 changes: 6 additions & 6 deletions tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

final class Kernel extends BaseKernel
{
Expand Down Expand Up @@ -58,7 +58,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
}
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes(RoutingConfigurator $routes): void
{
foreach ($this->getConfigurationDirectories() as $confDir) {
$this->loadRoutesConfiguration($routes, $confDir);
Expand Down Expand Up @@ -87,11 +87,11 @@ private function loadContainerConfiguration(LoaderInterface $loader, string $con
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
}

private function loadRoutesConfiguration(RouteCollectionBuilder $routes, string $confDir): void
private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
{
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS);
$routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
(new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env');
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env');
}

$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
Expand Down
7 changes: 6 additions & 1 deletion tests/Application/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Expand Down
2 changes: 0 additions & 2 deletions tests/Application/config/packages/dev/swiftmailer.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions tests/Application/config/packages/security_checker.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Application/config/packages/staging/swiftmailer.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Application/config/packages/swiftmailer.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Application/config/packages/test/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
handler_id: ~
3 changes: 0 additions & 3 deletions tests/Application/config/packages/test/security.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions tests/Application/config/packages/test/swiftmailer.yaml

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Application/config/routes/sylius_shop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sylius_shop_default_locale:
path: /
methods: [GET]
defaults:
_controller: sylius.controller.shop.locale_switch:switchAction
_controller: sylius.controller.shop.locale_switch::switchAction
6 changes: 0 additions & 6 deletions tests/Application/config/sylius/1.10/bundles.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 90dfc54

Please sign in to comment.