diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 62c6fa00..8103a8f5 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
php-version:
- - "7.4" # Always use the lowest version of PHP since a higher version would create actual syntax errors in lower versions
+ - "8.0" # Always use the lowest version of PHP since a higher version would create actual syntax errors in lower versions
dependencies:
- "highest"
@@ -68,7 +68,6 @@ jobs:
strategy:
matrix:
php-version:
- - "7.4"
- "8.0"
- "8.1"
- "8.2"
@@ -138,7 +137,6 @@ jobs:
strategy:
matrix:
php-version:
- - "7.4"
- "8.0"
- "8.1"
- "8.2"
@@ -205,7 +203,6 @@ jobs:
strategy:
matrix:
php-version:
- - "7.4"
- "8.0"
- "8.1"
- "8.2"
@@ -271,7 +268,6 @@ jobs:
strategy:
matrix:
php-version:
- - "7.4"
- "8.0"
- "8.1"
- "8.2"
diff --git a/composer.json b/composer.json
index 4b1dbd30..4b4c7bc6 100644
--- a/composer.json
+++ b/composer.json
@@ -4,7 +4,7 @@
"license": "MIT",
"type": "sylius-plugin",
"require": {
- "php": ">=7.4",
+ "php": "^8.0",
"ext-filter": "*",
"ext-mbstring": "*",
"api-platform/core": "^2.6",
@@ -68,8 +68,7 @@
"psalm/plugin-symfony": "^5.0",
"setono/code-quality-pack": "^2.6",
"setono/sylius-behat-pack": "^0.2.2",
- "setono/sylius-catalog-promotion-plugin": "^0.4.8 || ^0.5",
- "sylius/sylius": "~1.10.14",
+ "sylius/sylius": "~1.12.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
diff --git a/src/DependencyInjection/SetonoSyliusGiftCardExtension.php b/src/DependencyInjection/SetonoSyliusGiftCardExtension.php
index 5d77169a..7de2bfad 100644
--- a/src/DependencyInjection/SetonoSyliusGiftCardExtension.php
+++ b/src/DependencyInjection/SetonoSyliusGiftCardExtension.php
@@ -68,10 +68,6 @@ public function load(array $configs, ContainerBuilder $container): void
if ($container->hasParameter('kernel.bundles')) {
$bundles = $container->getParameter('kernel.bundles');
Assert::isArray($bundles);
-
- if (array_key_exists('SetonoSyliusCatalogPromotionPlugin', $bundles)) {
- $loader->load('services/conditional/catalog_promotion_rule.xml');
- }
}
}
}
diff --git a/src/Model/OrderItemTrait.php b/src/Model/OrderItemTrait.php
deleted file mode 100644
index 2d4a40d1..00000000
--- a/src/Model/OrderItemTrait.php
+++ /dev/null
@@ -1,15 +0,0 @@
-getProduct()->isGiftCard();
- }
-}
diff --git a/src/Model/OrderItemUnitTrait.php b/src/Model/OrderItemUnitTrait.php
index 80cf5cd6..b69b5717 100644
--- a/src/Model/OrderItemUnitTrait.php
+++ b/src/Model/OrderItemUnitTrait.php
@@ -8,7 +8,7 @@
trait OrderItemUnitTrait
{
- /** @ORM\OneToOne (targetEntity="Setono\SyliusGiftCardPlugin\Model\GiftCardInterface", mappedBy="orderItemUnit") */
+ /** @ORM\OneToOne (targetEntity="Setono\SyliusGiftCardPlugin\Model\GiftCardInterface", mappedBy="orderItemUnit", cascade={"all"}) */
protected ?GiftCardInterface $giftCard = null;
public function getGiftCard(): ?GiftCardInterface
diff --git a/src/Resources/config/api_resources/Order.xml b/src/Resources/config/api_resources/Order.xml
index 08b8cd2e..5d83d2e6 100644
--- a/src/Resources/config/api_resources/Order.xml
+++ b/src/Resources/config/api_resources/Order.xml
@@ -100,7 +100,7 @@
PATCH
/shop/orders/{tokenValue}/address
input
- Sylius\Bundle\ApiBundle\Command\Checkout\AddressOrder
+ Sylius\Bundle\ApiBundle\Command\Checkout\UpdateCart
shop:cart:address
@@ -330,7 +330,7 @@
PATCH
/shop/orders/{tokenValue}/apply-coupon
input
- Sylius\Bundle\ApiBundle\Command\Cart\ApplyCouponToCart
+ Sylius\Bundle\ApiBundle\Command\Checkout\UpdateCart
shop:cart:apply_coupon
diff --git a/src/Resources/config/doctrine/model/GiftCard.orm.xml b/src/Resources/config/doctrine/model/GiftCard.orm.xml
index ea4b7f01..bcc1210c 100644
--- a/src/Resources/config/doctrine/model/GiftCard.orm.xml
+++ b/src/Resources/config/doctrine/model/GiftCard.orm.xml
@@ -33,6 +33,9 @@
+
+
+
diff --git a/tests/Application/.env b/tests/Application/.env
index dff1da0e..919162d8 100644
--- a/tests/Application/.env
+++ b/tests/Application/.env
@@ -25,5 +25,5 @@ JWT_PASSPHRASE=setono_sylius_gift_card_plugin_development
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
-MAILER_URL=null://localhost
+MAILER_DSN=null://localhost
###< symfony/swiftmailer-bundle ###
diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php
index 37793cc7..35702744 100644
--- a/tests/Application/Kernel.php
+++ b/tests/Application/Kernel.php
@@ -23,6 +23,7 @@
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
+use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Webmozart\Assert\Assert;
@@ -64,25 +65,25 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
}
- protected function configureRoutes(RouteCollectionBuilder $routes): void
+ protected function configureRoutes(RoutingConfigurator $routes): void
{
$confDir = $this->getProjectDir() . '/config';
- $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, 'glob');
+ $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS,'glob');
+ $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, 'glob');
}
protected function getContainerBaseClass(): string
{
- if ($this->isTestEnvironment()) {
+ if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) {
return MockerContainer::class;
}
return parent::getContainerBaseClass();
}
- protected function getContainerLoader(ContainerInterface $container): LoaderInterface
+ protected function getContainerLoader(ContainerInterface $container): DelegatingLoader
{
/** @var ContainerBuilder $container */
Assert::isInstanceOf($container, ContainerBuilder::class);
diff --git a/tests/Application/Model/ChannelPricing.php b/tests/Application/Model/ChannelPricing.php
deleted file mode 100644
index a4297c6b..00000000
--- a/tests/Application/Model/ChannelPricing.php
+++ /dev/null
@@ -1,19 +0,0 @@
- ['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],
@@ -34,8 +33,6 @@
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
// End: In test app, those 3 needs to be loaded before our plugin or the Api Resource override won't work
Setono\SyliusGiftCardPlugin\SetonoSyliusGiftCardPlugin::class => ['all' => true],
- Setono\JobStatusBundle\SetonoJobStatusBundle::class => ['all' => true],
- Setono\SyliusCatalogPromotionPlugin\SetonoSyliusCatalogPromotionPlugin::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
@@ -61,4 +58,6 @@
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
+ League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
+ Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
];
diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml
index c1b59141..f8c0aa27 100644
--- a/tests/Application/config/packages/_sylius.yaml
+++ b/tests/Application/config/packages/_sylius.yaml
@@ -11,13 +11,6 @@ sylius_shop:
product_grid:
include_all_descendants: true
-sylius_core:
- resources:
- channel_pricing:
- classes:
- model: Tests\Setono\SyliusGiftCardPlugin\Application\Model\ChannelPricing
- repository: Tests\Setono\SyliusGiftCardPlugin\Application\Repository\ChannelPricingRepository
-
sylius_customer:
resources:
customer:
@@ -42,8 +35,6 @@ sylius_product:
product:
classes:
model: Tests\Setono\SyliusGiftCardPlugin\Application\Model\Product
- repository: Tests\Setono\SyliusGiftCardPlugin\Application\Repository\ProductRepository
product_variant:
classes:
- repository: Tests\Setono\SyliusGiftCardPlugin\Application\Repository\ProductVariantRepository
diff --git a/tests/Application/config/packages/mailer.yaml b/tests/Application/config/packages/mailer.yaml
new file mode 100644
index 00000000..56a650d8
--- /dev/null
+++ b/tests/Application/config/packages/mailer.yaml
@@ -0,0 +1,3 @@
+framework:
+ mailer:
+ dsn: '%env(MAILER_DSN)%'
diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml
index 51a6ec9a..2da5a5ca 100644
--- a/tests/Application/config/packages/security.yaml
+++ b/tests/Application/config/packages/security.yaml
@@ -1,17 +1,5 @@
-parameters:
- sylius.security.admin_regex: "^/%sylius_admin.path_name%"
- sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|api/.*|api$|media/.*)[^/]++"
- sylius.security.new_api_route: "/api/v2"
- sylius.security.new_api_regex: "^%sylius.security.new_api_route%"
- sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin"
- sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%"
- sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop"
- sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%"
- sylius.security.new_api_user_account_route: "%sylius.security.new_api_shop_route%/account"
- sylius.security.new_api_user_account_regex: "^%sylius.security.new_api_user_account_route%"
-
security:
- always_authenticate_before_granting: true
+ enable_authenticator_manager: true
providers:
sylius_admin_user_provider:
id: sylius.admin_user_provider.email_or_name_based
@@ -21,8 +9,8 @@ security:
id: sylius.shop_user_provider.email_or_name_based
sylius_api_shop_user_provider:
id: sylius.shop_user_provider.email_or_name_based
-
- encoders:
+
+ password_hashers:
Sylius\Component\User\Model\UserInterface: argon2i
firewalls:
admin:
@@ -38,7 +26,7 @@ security:
default_target_path: sylius_admin_dashboard
use_forward: false
use_referer: true
- csrf_token_generator: security.csrf.token_manager
+ enable_csrf: true
csrf_parameter: _csrf_admin_security_token
csrf_token_id: admin_authenticate
remember_me:
@@ -50,38 +38,33 @@ security:
logout:
path: sylius_admin_logout
target: sylius_admin_login
- anonymous: true
-
+
new_api_admin_user:
pattern: "%sylius.security.new_api_admin_regex%/.*"
provider: sylius_api_admin_user_provider
stateless: true
- anonymous: true
+ entry_point: jwt
json_login:
check_path: "%sylius.security.new_api_admin_route%/authentication-token"
username_path: email
password_path: password
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
- guard:
- authenticators:
- - lexik_jwt_authentication.jwt_token_authenticator
-
+ jwt: true
+
new_api_shop_user:
pattern: "%sylius.security.new_api_shop_regex%/.*"
provider: sylius_api_shop_user_provider
stateless: true
- anonymous: true
+ entry_point: jwt
json_login:
check_path: "%sylius.security.new_api_shop_route%/authentication-token"
username_path: email
password_path: password
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
- guard:
- authenticators:
- - lexik_jwt_authentication.jwt_token_authenticator
-
+ jwt: true
+
shop:
switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
context: shop
@@ -97,7 +80,7 @@ security:
default_target_path: sylius_shop_homepage
use_forward: false
use_referer: true
- csrf_token_generator: security.csrf.token_manager
+ enable_csrf: true
csrf_parameter: _csrf_shop_security_token
csrf_token_id: shop_authenticate
remember_me:
@@ -107,36 +90,33 @@ security:
remember_me_parameter: _remember_me
logout:
path: sylius_shop_logout
- target: sylius_shop_login
+ target: sylius_shop_homepage
invalidate_session: false
- success_handler: sylius.handler.shop_user_logout
- anonymous: true
-
+
dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
- security: false
-
- image_resolver:
- pattern: ^/media/cache/resolve
+ pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
-
+
access_control:
- - { path: "%sylius.security.admin_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] }
+ - { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS }
- - { path: "%sylius.security.shop_regex%/_partial", role: IS_AUTHENTICATED_ANONYMOUSLY, ips: [127.0.0.1, ::1] }
+ - { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
- { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }
- - { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: "%sylius.security.shop_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY }
+ - { path: "%sylius.security.admin_regex%/forgotten-password", role: PUBLIC_ACCESS }
+
+ - { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.shop_regex%/login", role: PUBLIC_ACCESS }
- - { path: "%sylius.security.shop_regex%/register", role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: "%sylius.security.shop_regex%/verify", role: IS_AUTHENTICATED_ANONYMOUSLY }
+ - { path: "%sylius.security.shop_regex%/register", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.shop_regex%/verify", role: PUBLIC_ACCESS }
- { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }
+ - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS }
- { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS }
- - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
+ - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS }
- { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
- - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY }
+ - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS }
diff --git a/tests/Application/config/packages/setono_sylius_catalog_promotion.yaml b/tests/Application/config/packages/setono_sylius_catalog_promotion.yaml
deleted file mode 100644
index 77193210..00000000
--- a/tests/Application/config/packages/setono_sylius_catalog_promotion.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-imports:
- - { resource: "@SetonoSyliusCatalogPromotionPlugin/Resources/config/app/config.yaml" }
- # Uncomment if you want to add some catalog promotion fixtures to default suite
- # - { resource: "@SetonoSyliusCatalogPromotionPlugin/Resources/config/app/fixtures.yaml" }
diff --git a/tests/Application/config/packages/staging/swiftmailer.yaml b/tests/Application/config/packages/staging/swiftmailer.yaml
deleted file mode 100644
index f4380780..00000000
--- a/tests/Application/config/packages/staging/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- disable_delivery: true
diff --git a/tests/Application/config/packages/swiftmailer.yaml b/tests/Application/config/packages/swiftmailer.yaml
deleted file mode 100644
index 3bab0d32..00000000
--- a/tests/Application/config/packages/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- url: '%env(MAILER_URL)%'
diff --git a/tests/Application/config/packages/test/mailer.yaml b/tests/Application/config/packages/test/mailer.yaml
new file mode 100644
index 00000000..092eb288
--- /dev/null
+++ b/tests/Application/config/packages/test/mailer.yaml
@@ -0,0 +1,7 @@
+framework:
+ mailer:
+ dsn: 'null://null'
+ cache:
+ pools:
+ test.mailer_pool:
+ adapter: cache.adapter.filesystem
diff --git a/tests/Application/config/packages/test/swiftmailer.yaml b/tests/Application/config/packages/test/swiftmailer.yaml
deleted file mode 100644
index c438f4b2..00000000
--- a/tests/Application/config/packages/test/swiftmailer.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-swiftmailer:
- disable_delivery: true
- logging: true
- spool:
- type: file
- path: "%kernel.cache_dir%/spool"
diff --git a/tests/Application/config/routes/setono_sylius_catalog_promotion.yaml b/tests/Application/config/routes/setono_sylius_catalog_promotion.yaml
deleted file mode 100644
index 4a11809d..00000000
--- a/tests/Application/config/routes/setono_sylius_catalog_promotion.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-setono_sylius_catalog_promotion_admin:
- resource: "@SetonoSyliusCatalogPromotionPlugin/Resources/config/admin_routing.yaml"
- prefix: /admin
diff --git a/tests/Application/package.json b/tests/Application/package.json
index e990ba42..c535d10b 100644
--- a/tests/Application/package.json
+++ b/tests/Application/package.json
@@ -1,6 +1,6 @@
{
"dependencies": {
- "chart.js": "^2.9",
+ "chart.js": "^3.7.1",
"jquery": "^3.6",
"jquery.dirtyforms": "^2.0",
"lightbox2": "^2.9",