diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4053484..4d40d74 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,8 +28,8 @@ jobs:
strategy:
fail-fast: false
matrix:
- php: [ 8.0 ]
- symfony: [ ^5.4, ^6.0 ]
+ php: [ 8.2 ]
+ symfony: [ ^6.4, ^7.1 ]
steps:
-
@@ -88,12 +88,7 @@ jobs:
-
name: Run ECS
- run: vendor/bin/ecs check src
- if: always() && steps.end-of-setup.outcome == 'success'
-
- -
- name: Run Psalm
- run: vendor/bin/psalm --show-info=false --output-format=github
+ run: vendor/bin/ecs check
if: always() && steps.end-of-setup.outcome == 'success'
-
@@ -108,43 +103,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- php: [7.3, 7.4, 8.0]
- symfony: [^5.4, ^6.0]
- sylius: [~1.9.0, ~1.10.0, ~1.11.0, ~1.12.0]
- node: [18.x]
- mysql: [5.7]
-
- exclude:
- -
- sylius: ~1.9.0
- php: 8.0
- -
- sylius: ~1.10.0
- php: 7.3
- -
- sylius: ~1.10.0
- symfony: ^6.0
- -
- sylius: ~1.11.0
- php: 7.3
- -
- sylius: ~1.11.0
- php: 7.4
- -
- sylius: ~1.11.0
- symfony: ^6.0
- -
- sylius: ~1.12.0
- php: 7.3
- -
- sylius: ~1.12.0
- php: 7.4
- -
- php: 7.3
- symfony: ^6.0
- -
- php: 7.4
- symfony: ^6.0
+ php: [8.2, 8.3]
+ symfony: [^6.4, ^7.1]
+ sylius: [~2.0.0]
+ node: [20.x]
+ mysql: [8]
env:
APP_ENV: test
diff --git a/README.md b/README.md
index 057c8dd..cac4436 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Build Status][ico-github-actions]][link-github-actions]
-[![Quality Score][ico-code-quality]][link-code-quality]
# Sylius Plugin adding hCaptcha integration
@@ -33,6 +32,15 @@ return [
];
```
+Import global configuration, by creating a new file `config/packages/fluxse_sylius_hcaptcha.yaml` :
+
+```yaml
+imports:
+ - { resource: "@FluxSESyliusHCaptchaPlugin/config/config.yaml" }
+```
+
+### Meteo Concept hCaptcha Bundle configuration
+
This plugin is using the `meteo-concept/hcaptcha-bundle` to handle the validation of the
hCaptcha, so a little configuration have to be made.
Add or modify the `meteo-concept/hcaptcha-bundle` configuration :
@@ -60,9 +68,7 @@ HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000
[ico-version]: http://poser.pugx.org/flux-se/sylius-hcaptcha-plugin/v
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-github-actions]: https://github.com/FLUX-SE/SyliusHCaptchaPlugin/workflows/Build/badge.svg
-[ico-code-quality]: https://img.shields.io/scrutinizer/g/FLUX-SE/SyliusHCaptchaPlugin.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/flux-se/sylius-hcaptcha-plugin
[link-github-actions]: https://github.com/FLUX-SE/SyliusHCaptchaPlugin/actions?query=workflow%3A"Build"
[link-scrutinizer]: https://scrutinizer-ci.com/g/FLUX-SE/SyliusHCaptchaPlugin/code-structure
-[link-code-quality]: https://scrutinizer-ci.com/g/FLUX-SE/SyliusHCaptchaPlugin
diff --git a/composer.json b/composer.json
index 4f435cf..9df7d21 100644
--- a/composer.json
+++ b/composer.json
@@ -11,8 +11,8 @@
}
],
"require": {
- "sylius/sylius": "^1.4",
- "meteo-concept/hcaptcha-bundle": ">=2"
+ "sylius/shop-bundle": "^2.0",
+ "meteo-concept/hcaptcha-bundle": "^3|^4"
},
"require-dev": {
"ext-json": "*",
@@ -27,23 +27,24 @@
"friends-of-behat/variadic-extension": "^1.3",
"nyholm/psr7": "^1.4",
"phpspec/phpspec": "^7.0",
- "phpstan/extension-installer": "^1.2",
- "phpstan/phpstan-doctrine": "^1",
- "phpstan/phpstan-strict-rules": "^1",
- "phpstan/phpstan-webmozart-assert": "^1",
- "phpunit/phpunit": "^9.5",
+ "phpstan/extension-installer": "^1.4",
+ "phpstan/phpstan": "^1.12",
+ "phpstan/phpstan-doctrine": "^1.5",
+ "phpstan/phpstan-symfony": "^1.4",
+ "phpstan/phpstan-webmozart-assert": "^1.2",
+ "phpunit/phpunit": "^10",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"robertfausk/behat-panther-extension": "^1.1",
+ "sylius/sylius": "^2.0",
"sylius-labs/coding-standard": "^4.0",
- "symfony/browser-kit": "^5.4|^6.0",
- "symfony/debug-bundle": "^5.4|^6.0",
- "symfony/dotenv": "^5.4|^6.0",
- "symfony/http-client": "^5.4|^6.0",
- "symfony/intl": "^5.4|^6.0",
- "symfony/runtime": "^5.4|^6.0",
- "symfony/web-profiler-bundle": "^5.4|^6.0",
- "symfony/webpack-encore-bundle": "^1.16",
- "vimeo/psalm": "^4|^5",
+ "symfony/browser-kit": "^6.4 || ^7.1",
+ "symfony/debug-bundle": "^6.4 || ^7.1",
+ "symfony/dotenv": "^6.4 || ^7.1",
+ "symfony/http-client": "^6.4 || ^7.1",
+ "symfony/intl": "^6.4 || ^7.1",
+ "symfony/runtime": "^6.4 || ^7.1",
+ "symfony/web-profiler-bundle": "^6.4 || ^7.1",
+ "symfony/webpack-encore-bundle": "^2.2",
"dbrekelmans/bdi": "^1.0"
},
"suggest": {
diff --git a/config/config.yaml b/config/config.yaml
new file mode 100644
index 0000000..805ec5c
--- /dev/null
+++ b/config/config.yaml
@@ -0,0 +1,10 @@
+sylius_twig_hooks:
+ hooks:
+ sylius_shop.account.register.content.form:
+ h_captcha:
+ template: '@FluxSESyliusHCaptchaPlugin/form.html.twig'
+ priority: 10
+ sylius_shop.contact.contact_request.content.form:
+ h_captcha:
+ template: '@FluxSESyliusHCaptchaPlugin/form.html.twig'
+ priority: 10
diff --git a/src/Resources/config/services.yaml b/config/services.yaml
similarity index 100%
rename from src/Resources/config/services.yaml
rename to config/services.yaml
diff --git a/ecs.php b/ecs.php
index cd3d17f..2908459 100644
--- a/ecs.php
+++ b/ecs.php
@@ -2,17 +2,14 @@
declare(strict_types=1);
-use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
-return static function (ECSConfig $ecsConfig): void {
- $ecsConfig->import(__DIR__ . '/vendor/sylius-labs/coding-standard/ecs.php');
-
- $services = $ecsConfig->services();
-
- // PHP 7 compatibility
- $services
- ->set(TrailingCommaInMultilineFixer::class)
- ->call('configure', [['elements' => ['arrays']]])
- ;
-};
+return ECSConfig::configure()
+ ->withSets([
+ 'vendor/sylius-labs/coding-standard/ecs.php',
+ ])
+ ->withPaths([
+ 'src',
+ 'tests/Behat',
+ ])
+;
diff --git a/phpstan.neon b/phpstan.neon
new file mode 100644
index 0000000..98373df
--- /dev/null
+++ b/phpstan.neon
@@ -0,0 +1,6 @@
+includes:
+ - 'phpstan.neon.dist'
+
+parameters:
+ editorUrl: '%%file%%:%%line%%'
+
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 98d1ccd..15d01e0 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -1,22 +1,7 @@
parameters:
- reportUnmatchedIgnoredErrors: false
- checkMissingIterableValueType: false
level: max
paths:
- src
- - tests
-
- excludePaths:
- # Makes PHPStan crash
- - 'src/DependencyInjection/Configuration.php'
-
- - tests/Application/Kernel.php
- - tests/Application/public/index.php
- - tests/Application/config/**.php
- - tests/Application/var/**.php
- - tests/Application/node_modules/**.php
-
- ignoreErrors:
- - '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./'
+ - tests/Behat
diff --git a/src/DependencyInjection/CompilerPass/SymfonyHttpClientCompilerPass.php b/src/DependencyInjection/CompilerPass/SymfonyHttpClientCompilerPass.php
index 9b85e44..d85aafe 100644
--- a/src/DependencyInjection/CompilerPass/SymfonyHttpClientCompilerPass.php
+++ b/src/DependencyInjection/CompilerPass/SymfonyHttpClientCompilerPass.php
@@ -20,21 +20,21 @@ public function process(ContainerBuilder $container): void
if (false === $container->has(ClientInterface::class)) {
$container->setDefinition(
ClientInterface::class,
- new Definition(Psr18Client::class)
+ new Definition(Psr18Client::class),
);
}
if (false === $container->has(RequestFactoryInterface::class)) {
$container->setDefinition(
RequestFactoryInterface::class,
- new Definition(Psr17Factory::class)
+ new Definition(Psr17Factory::class),
);
}
if (false === $container->has(StreamFactoryInterface::class)) {
$container->setDefinition(
StreamFactoryInterface::class,
- new Definition(Psr17Factory::class)
+ new Definition(Psr17Factory::class),
);
}
}
diff --git a/src/DependencyInjection/FluxSESyliusHCaptchaExtension.php b/src/DependencyInjection/FluxSESyliusHCaptchaExtension.php
index 37b8ffa..01bd85a 100644
--- a/src/DependencyInjection/FluxSESyliusHCaptchaExtension.php
+++ b/src/DependencyInjection/FluxSESyliusHCaptchaExtension.php
@@ -7,54 +7,13 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
-use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-final class FluxSESyliusHCaptchaExtension extends Extension implements PrependExtensionInterface
+final class FluxSESyliusHCaptchaExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
- $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
+ $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.yaml');
}
-
- public function prepend(ContainerBuilder $container): void
- {
- if ($container->hasExtension('twig')) {
- $container->prependExtensionConfig(
- 'twig',
- [
- 'form_themes' => [
- '@FluxSESyliusHCaptchaPlugin/hcaptcha.html.twig',
- ],
- ]
- );
- }
-
- if ($container->hasExtension('sylius_ui')) {
- $container->prependExtensionConfig(
- 'sylius_ui',
- [
- 'events' => [
- 'sylius.shop.contact.request.form' => [
- 'blocks' => [
- 'captcha' => [
- 'template' => '@FluxSESyliusHCaptchaPlugin/form.html.twig',
- 'priority' => -10,
- ],
- ],
- ],
- 'sylius.shop.register.form' => [
- 'blocks' => [
- 'captcha' => [
- 'template' => '@FluxSESyliusHCaptchaPlugin/form.html.twig',
- 'priority' => -10,
- ],
- ],
- ],
- ],
- ]
- );
- }
- }
}
diff --git a/src/FluxSESyliusHCaptchaPlugin.php b/src/FluxSESyliusHCaptchaPlugin.php
index e55a3ef..ac851c1 100644
--- a/src/FluxSESyliusHCaptchaPlugin.php
+++ b/src/FluxSESyliusHCaptchaPlugin.php
@@ -21,4 +21,9 @@ public function build(ContainerBuilder $container): void
->addCompilerPass(new SymfonyHttpClientCompilerPass())
;
}
+
+ public function getPath(): string
+ {
+ return dirname(__DIR__);
+ }
}
diff --git a/src/Resources/views/form.html.twig b/src/Resources/views/form.html.twig
deleted file mode 100644
index d06feb7..0000000
--- a/src/Resources/views/form.html.twig
+++ /dev/null
@@ -1 +0,0 @@
-{{ form_row(form.captcha) }}
diff --git a/templates/form.html.twig b/templates/form.html.twig
new file mode 100644
index 0000000..e4f27d6
--- /dev/null
+++ b/templates/form.html.twig
@@ -0,0 +1,5 @@
+{% form_theme hookable_metadata.context.form '@FluxSESyliusHCaptchaPlugin/hcaptcha.html.twig' %}
+
+
+ {{ form_row(hookable_metadata.context.form.captcha) }}
+
diff --git a/src/Resources/views/hcaptcha.html.twig b/templates/hcaptcha.html.twig
similarity index 100%
rename from src/Resources/views/hcaptcha.html.twig
rename to templates/hcaptcha.html.twig
diff --git a/tests/Application/.env b/tests/Application/.env
index dbe2b28..dfb4e91 100644
--- a/tests/Application/.env
+++ b/tests/Application/.env
@@ -9,40 +9,35 @@ APP_SECRET=EDITME
###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
-# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
-# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
-# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
-DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%?serverVersion=5.7
+# Choose one of the following DBMS, adjust the server version and charset if needed
+DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment%?serverVersion=8&charset=utf8mb4
+#DATABASE_URL=pgsql://postgres:postgres@127.0.0.1/sylius_%kernel.environment%?serverVersion=15&charset=utf8
###< doctrine/doctrine-bundle ###
+###> symfony/messenger ###
+# Choose one of the transports below
+# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
+# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
+MESSENGER_TRANSPORT_DSN=doctrine://default
+SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN=doctrine://default
+SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=doctrine://default?queue_name=main_failed
+SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=doctrine://default?queue_name=catalog_promotion_removal
+SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=doctrine://default?queue_name=catalog_promotion_removal_failed
+SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN=sync://
+###< symfony/messenger ###
+
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
-JWT_PASSPHRASE=acme_plugin_development
+JWT_PASSPHRASE=e7c5fca1060bdf6ad23c33e4c236081f
###< lexik/jwt-authentication-bundle ###
-###> symfony/swiftmailer-bundle ###
-# 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=smtp://localhost
-###< symfony/swiftmailer-bundle ###
-
###> symfony/mailer ###
MAILER_DSN=null://null
###< symfony/mailer ###
-###> symfony/messenger ###
-# Choose one of the transports below
-# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
-MESSENGER_TRANSPORT_DSN=sync://
-# Sylius > 1.12.4
-SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN=sync://
-SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=sync://
-SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=sync://
-SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=sync://
-# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
-###< symfony/messenger ###
+SYLIUS_PAYMENT_ENCRYPTION_KEY_PATH=%kernel.project_dir%/config/encryption/dev.key
###> meteo-concept/hcaptcha-bundle ###
HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001
diff --git a/tests/Application/.env.test b/tests/Application/.env.test
index 726d24d..0c039b6 100644
--- a/tests/Application/.env.test
+++ b/tests/Application/.env.test
@@ -1,18 +1,7 @@
-###> symfony/framework-bundle ###
-APP_ENV=test
-APP_DEBUG=1
-APP_SECRET=ch4mb3r0f5ecr3ts
-###< symfony/framework-bundle ###
+APP_SECRET='s$cretf0rt3st'
KERNEL_CLASS='Tests\FluxSE\SyliusHCaptchaPlugin\Application\Kernel'
-###> symfony/swiftmailer-bundle ###
-# 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
-###< symfony/swiftmailer-bundle ###
-
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem
@@ -20,9 +9,14 @@ JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LO
###< lexik/jwt-authentication-bundle ###
###> symfony/messenger ###
+# Sync transport turned for testing env for the ease of testing
MESSENGER_TRANSPORT_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_MAIN_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_MAIN_FAILED_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=sync://
+SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN=sync://
###< symfony/messenger ###
-###> symfony/mailer ###
-MAILER_DSN=null://null
-###< symfony/mailer ###
+SYLIUS_PAYMENT_ENCRYPTION_KEY_PATH=%kernel.project_dir%/config/encryption/test.key
diff --git a/tests/Application/.eslintrc.js b/tests/Application/.eslintrc.js
deleted file mode 100644
index b189064..0000000
--- a/tests/Application/.eslintrc.js
+++ /dev/null
@@ -1,25 +0,0 @@
-module.exports = {
- extends: [
- 'airbnb-base',
- ],
- env: {
- node: true,
- },
- rules: {
- 'object-shorthand': ['error', 'always', {
- avoidQuotes: true,
- avoidExplicitReturnArrows: true,
- }],
- 'function-paren-newline': ['error', 'consistent'],
- 'max-len': ['warn', 120, 2, {
- ignoreUrls: true,
- ignoreComments: false,
- ignoreRegExpLiterals: true,
- ignoreStrings: true,
- ignoreTemplateLiterals: true,
- }],
- },
- settings: {
- 'import/resolver': 'webpack',
- },
-};
diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore
index bc600a8..a6c0fa5 100644
--- a/tests/Application/.gitignore
+++ b/tests/Application/.gitignore
@@ -2,12 +2,12 @@
/public/build
/public/css
/public/js
-/public/media/*
-!/public/media/image/
-/public/media/image/*
-!/public/media/image/.gitignore
+/public/media
+!/public/media/image/.gitkeep
+
+/etc/build/*
+!/etc/build/.gitignore
-/node_modules
###> symfony/framework-bundle ###
/.env.*.local
@@ -18,6 +18,24 @@
/vendor/
###< symfony/framework-bundle ###
+###> lexik/jwt-authentication-bundle ###
+/config/jwt/*.pem
+!/config/jwt/*-test.pem
+###< lexik/jwt-authentication-bundle ###
+
+###> symfony/webpack-encore-bundle ###
+/node_modules/
+/public/build/
+/npm-debug.log
+/yarn-error.log
+/yarn.lock
+/package-lock.json
+###< symfony/webpack-encore-bundle ###
+
+###> liip/imagine-bundle ###
+/public/media/cache/
+###< liip/imagine-bundle ###
+
###> symfony/web-server-bundle ###
/.web-server-pid
###< symfony/web-server-bundle ###
diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php
index ed657a2..d27274f 100644
--- a/tests/Application/Kernel.php
+++ b/tests/Application/Kernel.php
@@ -4,126 +4,10 @@
namespace Tests\FluxSE\SyliusHCaptchaPlugin\Application;
-use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
-use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
-use Symfony\Component\Config\Loader\LoaderInterface;
-use Symfony\Component\Config\Resource\FileResource;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
-use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
-/**
- * @property string $environment
- */
final class Kernel extends BaseKernel
{
use MicroKernelTrait;
-
- private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
-
- public function getCacheDir(): string
- {
- return $this->getProjectDir() . '/var/cache/' . $this->environment;
- }
-
- public function getLogDir(): string
- {
- return $this->getProjectDir() . '/var/log';
- }
-
- public function registerBundles(): iterable
- {
- foreach ($this->getConfigurationDirectories() as $confDir) {
- $bundlesFile = $confDir . '/bundles.php';
- if (false === is_file($bundlesFile)) {
- continue;
- }
- yield from $this->registerBundlesFromFile($bundlesFile);
- }
- }
-
- private function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
- {
- foreach ($this->getConfigurationDirectories() as $confDir) {
- $bundlesFile = $confDir . '/bundles.php';
- if (false === is_file($bundlesFile)) {
- continue;
- }
- $container->addResource(new FileResource($bundlesFile));
- }
-
- $container->setParameter('container.dumper.inline_class_loader', true);
-
- foreach ($this->getConfigurationDirectories() as $confDir) {
- $this->loadContainerConfiguration($loader, $confDir);
- }
- }
-
- private function configureRoutes(RoutingConfigurator $routes): void
- {
- foreach ($this->getConfigurationDirectories() as $confDir) {
- $this->loadRoutesConfiguration($routes, $confDir);
- }
- }
-
- protected function getContainerBaseClass(): string
- {
- if ($this->isTestEnvironment()) {
- return MockerContainer::class;
- }
-
- return parent::getContainerBaseClass();
- }
-
- private function isTestEnvironment(): bool
- {
- return 0 === strpos($this->getEnvironment(), 'test');
- }
-
- private function loadContainerConfiguration(LoaderInterface $loader, string $confDir): void
- {
- $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob');
- $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob');
- $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob');
- $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob');
- }
-
- private function loadRoutesConfiguration(RoutingConfigurator $routes, string $confDir): void
- {
- $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS);
- $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS);
- $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS);
- }
-
- /**
- * @return BundleInterface[]
- */
- private function registerBundlesFromFile(string $bundlesFile): iterable
- {
- /** @var array $contents */
- $contents = require $bundlesFile;
- foreach ($contents as $class => $envs) {
- if (isset($envs['all']) || isset($envs[$this->environment])) {
- yield new $class();
- }
- }
- }
-
- /**
- * @return string[]
- */
- private function getConfigurationDirectories(): iterable
- {
- yield $this->getProjectDir() . '/config';
- $syliusConfigDir = $this->getProjectDir() . '/config/sylius/' . SyliusKernel::MAJOR_VERSION . '.' . SyliusKernel::MINOR_VERSION;
- if (is_dir($syliusConfigDir)) {
- yield $syliusConfigDir;
- }
- $symfonyConfigDir = $this->getProjectDir() . '/config/symfony/' . BaseKernel::MAJOR_VERSION . '.' . BaseKernel::MINOR_VERSION;
- if (is_dir($symfonyConfigDir)) {
- yield $symfonyConfigDir;
- }
- }
}
diff --git a/tests/Application/assets/admin/entry.js b/tests/Application/assets/admin/entry.js
deleted file mode 100644
index 635f5ac..0000000
--- a/tests/Application/assets/admin/entry.js
+++ /dev/null
@@ -1 +0,0 @@
-import 'sylius/bundle/AdminBundle/Resources/private/entry';
diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js
deleted file mode 100644
index aadc317..0000000
--- a/tests/Application/assets/shop/entry.js
+++ /dev/null
@@ -1 +0,0 @@
-import 'sylius/bundle/ShopBundle/Resources/private/entry';
diff --git a/tests/Application/config/bootstrap.php b/tests/Application/config/bootstrap.php
index 677571e..2291ab4 100644
--- a/tests/Application/config/bootstrap.php
+++ b/tests/Application/config/bootstrap.php
@@ -13,15 +13,11 @@
$_ENV += $env;
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
-} elseif (method_exists(Dotenv::class, 'bootEnv')) {
- (new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
-
- return;
} 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';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
-$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
+$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php
index 6afe08f..ff106bf 100644
--- a/tests/Application/config/bundles.php
+++ b/tests/Application/config/bundles.php
@@ -1,13 +1,12 @@
['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
+ Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true],
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true],
@@ -30,16 +29,12 @@
Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
- winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
- Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
- Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
- JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
- FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
+ BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
@@ -50,11 +45,19 @@
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true],
Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true],
- ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
+ ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
+ League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
+ Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true],
+ Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
+ Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
+ Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true],
+ Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
+ Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true],
+ Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
FluxSE\SyliusHCaptchaPlugin\FluxSESyliusHCaptchaPlugin::class => ['all' => true],
MeteoConcept\HCaptchaBundle\MeteoConceptHCaptchaBundle::class => ['all' => true],
];
diff --git a/tests/Application/config/symfony/.gitkeep b/tests/Application/config/encryption/.gitkeep
similarity index 100%
rename from tests/Application/config/symfony/.gitkeep
rename to tests/Application/config/encryption/.gitkeep
diff --git a/tests/Application/config/encryption/test.key b/tests/Application/config/encryption/test.key
new file mode 100644
index 0000000..0059874
--- /dev/null
+++ b/tests/Application/config/encryption/test.key
@@ -0,0 +1 @@
+31400500d6649581d6ac178bc41c92acc686dd869e6aa8665b4dad27f8921075e8cbf34059793bf9a0c603cd870f0433fb817afdb68bd75445111f27fe36a3252c8bd26fdbd82801568e9c657b022fd39edabff90518a2e04377e4e813bf3bf7d9411e6e
\ No newline at end of file
diff --git a/tests/Application/config/secrets/dev/.gitignore b/tests/Application/config/jwt/.gitkeep
similarity index 100%
rename from tests/Application/config/secrets/dev/.gitignore
rename to tests/Application/config/jwt/.gitkeep
diff --git a/tests/Application/config/jwt/private-test.pem b/tests/Application/config/jwt/private-test.pem
new file mode 100644
index 0000000..d2ff3d0
--- /dev/null
+++ b/tests/Application/config/jwt/private-test.pem
@@ -0,0 +1,30 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIhNMtc+21vO0CAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECJ3pCz5BZ5wBBIIEyKx/OW6jYrrN
+ZfcQn40CON3st4lO16QGaY3nwhtMfS3M0VBQWRXjGSTrUU72H3PEhqtM7v4av1ED
+Vf1hkIm2gGPb/qxctapG33aw0Ean1AhHtqVtiEN0C3tK8Jpx6ARYbFees1xkHd4R
+lIkl715D2K9eqZCWK5sljChGWPK97Jm2zTudLQImvzLDJLDDDd8T7HamG/GvDROc
+lzZeNEg3oO2DzYwu3yI3oHYORM7pWxaJr0hSe+147U/hHwRq7n0vWP3JnsJlmxoy
+gpN/ZG8qh+MdWaEdg9NmfjQSZK/N4ckIN3y/5ZeDXFxr5sQkLJk/V0ZU1j2qe6cj
+TG4DX3pAkNwPw0PrMdas0V9FwL9wIH/65uQg9HdlXQ5FoaaNk4i+OULhpkcQ9znn
++tArQcnEyHY+/ZC8flnnOGRiZLyjVf+L2zHp4eiEd+ftiT5uv6UAGtUYVd/ulSZm
+4do66tFRij6D5gkeS7KvSY952Ueq/3XqhCmJNbs3Hv9V9pCfdE420m9ntEbziZiM
+5YU+jrLcLe0B5WYZyX3koIWLD09GXC+JB0735q+o0RMYbVGHNIMh0y9PSBPNZj6X
+3ke2pHzigPhU4iuCUdt/KZHFN8UyiJH7EPYXRSTbGRTilvwe7ULEwiAZgqEng4qy
+UCpKlokZynI7q0uhE537hn/zafpqcjHrdrfuO9jRyQOLmDq1ockP842+QBxhCtDU
+N3A0hm03slIgGFikr4NsRki8osweDHSg0LaWyGBklQY0QHPh/e9XURfiqKI4LpkJ
+REr7Lo4S2J+D4jgnADnrRc+R7a6jiN/562e6B4JiVCt28m5qJCeiiUpErp07J/ks
+cpQ1i3TUpDoFFivmKkcJfneHKiaPaNjjcwUJf1szVp0I/rQ8zfe2zxqVW6ARUULp
+fD65fgZZsigkPEbk4eqgvbcqu7hLFddHzdgi4TXcI0QSrYx8JHJ6L9aaiUyHmiih
+W1gJ2jtn087ssN+yQ81bbs8tf3t+Efj7gge4kn7nye9r62adEpwrB3syT2uSt3yr
+qf/j8ycf6R8lvD0AZPQ0aLQu1hOKloduk5OkuPTZToHNuvvYR9wpyMhCQFOBGD1P
+trXGcAATIKDF4skG5A5ia36TcD07X+Nqb5obukQmbj3dMuPe3C4u1tFdykz5B4I9
+PJgiChRQ5J5Qg4xWXZdzmsuRC2YZT1SIIATnZ6PRnIlovhjBCtGKRVNjtljRqoIA
+opzPolaxCX6Cuo15zVO8HgGB4fPht+VD6Muann8cRBx7RCvR8QZhym/HVJxnu9OL
+mt+hYNUGgt+Kx5CKeDB98Vq7YOKjt9r0ocwnB/RzwgzwlXRoJ/m0Ra1VOmOJzAss
+Ib78x/tTt9C3YMzfGXHxNHy9XWU28xOW8SjghOgJFlW8JWRzjRQ0TYNtLYnw+i3B
+UpOhcdKiORmRew5gtjJd09Fu59U/YiDjAcCyauzTny8mNaseKgIWSUUviAexhbJL
+FsIjqjEI1OxdD9/mKdyEA2nk3AmjrPtY3exvaWtx5QFsQM+RSWxD3oZ0Ht0Wg3J1
+q5IW5YvyyjgGIVW2gtThpzUjsn68G9dPQ8fVdC99HY5aNwmZtX/uWZKx+cmbJQbP
+q3yyvW3b+6iYFIse6P/4Hg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/Application/config/jwt/public-test.pem b/tests/Application/config/jwt/public-test.pem
new file mode 100644
index 0000000..0635bfb
--- /dev/null
+++ b/tests/Application/config/jwt/public-test.pem
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApehy09MSecsyPhR8Ylkb
+WCzXZxSup/1TfAeOJEpQCm/D1bcJVwoUZFFgrWcVvwFtXOngSXwIq0jhTdQqS0No
+aeMR/lIvYK6ZBnz1+c3UU/rV2BvG4gSc07tVjyuaPuD1NBSBtIR5NY2gz2SatL9A
+ZfKMJBZhaVb1yMVbDfwa4WgQQ9rd7F/D2fqblPIPARaBzGbkKuMSXbb6kWurW2GJ
+1O8SyyHAv47Gr3PaB7MZxNMgsxJPBbIh8RZvpUBOvzvq0aAWlXTxNYp9iV5liPUA
+/aXhx+p4CqtD87BLJ+Iim/Vu6xBVom/+Yahl8yZsSIebQy2Y0JlSjhgQ27E5Q4zQ
+lwIDAQAB
+-----END PUBLIC KEY-----
diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml
index 7532b01..da15c39 100644
--- a/tests/Application/config/packages/_sylius.yaml
+++ b/tests/Application/config/packages/_sylius.yaml
@@ -1,15 +1,11 @@
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
-
+ - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" }
- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
-
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
-
- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }
+ - { resource: "../parameters.yaml" }
+
parameters:
sylius_core.public_dir: '%kernel.project_dir%/public'
-
-sylius_shop:
- product_grid:
- include_all_descendants: true
diff --git a/tests/Application/config/packages/api_platform.yaml b/tests/Application/config/packages/api_platform.yaml
new file mode 100644
index 0000000..9952e01
--- /dev/null
+++ b/tests/Application/config/packages/api_platform.yaml
@@ -0,0 +1,8 @@
+api_platform:
+ mapping:
+ paths:
+ - '%kernel.project_dir%/config/api_platform'
+ patch_formats:
+ json: ['application/merge-patch+json']
+ swagger:
+ versions: [3]
diff --git a/tests/Application/config/packages/assets.yaml b/tests/Application/config/packages/assets.yaml
index b1ea48b..f97b2f9 100644
--- a/tests/Application/config/packages/assets.yaml
+++ b/tests/Application/config/packages/assets.yaml
@@ -1,7 +1,7 @@
framework:
- assets:
- packages:
- shop:
- json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json'
- admin:
- json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json'
+ assets:
+ packages:
+ admin:
+ json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json'
+ shop:
+ json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json'
diff --git a/tests/Application/config/packages/debug.yaml b/tests/Application/config/packages/debug.yaml
new file mode 100644
index 0000000..ad874af
--- /dev/null
+++ b/tests/Application/config/packages/debug.yaml
@@ -0,0 +1,5 @@
+when@dev:
+ debug:
+ # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
+ # See the "server:dump" command to start a new server.
+ dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
diff --git a/tests/Application/config/packages/dev/framework.yaml b/tests/Application/config/packages/dev/framework.yaml
deleted file mode 100644
index 4b116de..0000000
--- a/tests/Application/config/packages/dev/framework.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-framework:
- profiler: { only_exceptions: false }
diff --git a/tests/Application/config/packages/dev/monolog.yaml b/tests/Application/config/packages/dev/monolog.yaml
deleted file mode 100644
index da2b092..0000000
--- a/tests/Application/config/packages/dev/monolog.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-monolog:
- handlers:
- main:
- type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: debug
- firephp:
- type: firephp
- level: info
diff --git a/tests/Application/config/packages/dev/routing.yaml b/tests/Application/config/packages/dev/routing.yaml
deleted file mode 100644
index 4116679..0000000
--- a/tests/Application/config/packages/dev/routing.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-framework:
- router:
- strict_requirements: true
diff --git a/tests/Application/config/packages/dev/web_profiler.yaml b/tests/Application/config/packages/dev/web_profiler.yaml
deleted file mode 100644
index 1f1cb2b..0000000
--- a/tests/Application/config/packages/dev/web_profiler.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-web_profiler:
- toolbar: true
- intercept_redirects: false
diff --git a/tests/Application/config/packages/doctrine_migrations.yaml b/tests/Application/config/packages/doctrine_migrations.yaml
index b3dffec..676e246 100644
--- a/tests/Application/config/packages/doctrine_migrations.yaml
+++ b/tests/Application/config/packages/doctrine_migrations.yaml
@@ -2,5 +2,8 @@ doctrine_migrations:
storage:
table_storage:
table_name: sylius_migrations
-# migrations_paths:
-# 'App\Migrations': '%kernel.project_dir%/src/Migrations/'
+ migrations_paths:
+ # namespace is arbitrary but should be different from App\Migrations
+ # as migrations classes should NOT be autoloaded
+ #'App': '%kernel.project_dir%/migrations'
+ enable_profiler: false
diff --git a/tests/Application/config/packages/fluxse_sylius_hcaptcha.yaml b/tests/Application/config/packages/fluxse_sylius_hcaptcha.yaml
new file mode 100644
index 0000000..542dc72
--- /dev/null
+++ b/tests/Application/config/packages/fluxse_sylius_hcaptcha.yaml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: "@FluxSESyliusHCaptchaPlugin/config/config.yaml" }
diff --git a/tests/Application/config/packages/flysystem.yaml b/tests/Application/config/packages/flysystem.yaml
new file mode 100644
index 0000000..cab68b7
--- /dev/null
+++ b/tests/Application/config/packages/flysystem.yaml
@@ -0,0 +1,7 @@
+flysystem:
+ storages:
+ sylius.storage:
+ adapter: 'local'
+ options:
+ directory: '%sylius_core.images_dir%'
+ directory_visibility: 'public'
diff --git a/tests/Application/config/packages/fos_rest.yaml b/tests/Application/config/packages/fos_rest.yaml
deleted file mode 100644
index a72eef7..0000000
--- a/tests/Application/config/packages/fos_rest.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-fos_rest:
- exception: true
- view:
- formats:
- json: true
- xml: true
- empty_content: 204
- format_listener:
- rules:
- - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true }
- - { path: '^/', stop: true }
diff --git a/tests/Application/config/packages/framework.yaml b/tests/Application/config/packages/framework.yaml
index 9b44501..7954fdb 100644
--- a/tests/Application/config/packages/framework.yaml
+++ b/tests/Application/config/packages/framework.yaml
@@ -1,6 +1,24 @@
framework:
+ translator: { fallbacks: ["%locale%"] }
secret: '%env(APP_SECRET)%'
- form: true
+ form:
+ enabled: true
csrf_protection: true
+ http_method_override: true
session:
handler_id: ~
+ serializer:
+ mapping:
+ paths: [ '%kernel.project_dir%/config/serialization' ]
+
+when@dev:
+ framework:
+ profiler: { only_exceptions: false }
+
+when@test: &framework_test
+ framework:
+ test: true
+ session:
+ storage_factory_id: session.storage.factory.mock_file
+
+when@test_cached: *framework_test
diff --git a/tests/Application/config/packages/http_discovery.yaml b/tests/Application/config/packages/http_discovery.yaml
new file mode 100644
index 0000000..2a789e7
--- /dev/null
+++ b/tests/Application/config/packages/http_discovery.yaml
@@ -0,0 +1,10 @@
+services:
+ Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory'
+ Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory'
+ Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory'
+ Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory'
+ Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory'
+ Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory'
+
+ http_discovery.psr17_factory:
+ class: Http\Discovery\Psr17Factory
diff --git a/tests/Application/config/packages/mailer.yaml b/tests/Application/config/packages/mailer.yaml
new file mode 100644
index 0000000..7acef57
--- /dev/null
+++ b/tests/Application/config/packages/mailer.yaml
@@ -0,0 +1,12 @@
+framework:
+ mailer:
+ dsn: '%env(MAILER_DSN)%'
+
+when@test: &mailer_test
+ framework:
+ cache:
+ pools:
+ test.mailer_pool:
+ adapter: cache.adapter.filesystem
+
+when@test_cached: *mailer_test
diff --git a/tests/Application/config/packages/monolog.yaml b/tests/Application/config/packages/monolog.yaml
new file mode 100644
index 0000000..31325fa
--- /dev/null
+++ b/tests/Application/config/packages/monolog.yaml
@@ -0,0 +1,63 @@
+monolog:
+ channels:
+ - deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
+
+when@prod:
+ monolog:
+ handlers:
+ main:
+ type: fingers_crossed
+ action_level: error
+ handler: nested
+ excluded_http_codes: [404, 405]
+ buffer_size: 50 # How many messages should be saved? Prevent memory leaks
+ nested:
+ type: stream
+ path: "%kernel.logs_dir%/%kernel.environment%.log"
+ level: debug
+ formatter: monolog.formatter.json
+ console:
+ type: console
+ process_psr_3_messages: false
+ channels: ["!event", "!doctrine"]
+ deprecation:
+ type: stream
+ channels: [deprecation]
+ path: "%kernel.logs_dir%/%kernel.environment%.log"
+ formatter: monolog.formatter.json
+
+when@dev:
+ monolog:
+ handlers:
+ main:
+ type: stream
+ path: "%kernel.logs_dir%/%kernel.environment%.log"
+ level: debug
+ channels: ["!event"]
+ # uncomment to get logging in your browser
+ # you may have to allow bigger header sizes in your Web server configuration
+ #firephp:
+ # type: firephp
+ # level: info
+ #chromephp:
+ # type: chromephp
+ # level: info
+ console:
+ type: console
+ process_psr_3_messages: false
+ channels: ["!event", "!doctrine", "!console"]
+
+when@test: &monolog_test
+ monolog:
+ handlers:
+ main:
+ type: fingers_crossed
+ action_level: error
+ handler: nested
+ channels: ["!event"]
+ nested:
+ type: stream
+ path: "%kernel.logs_dir%/%kernel.environment%.log"
+ level: debug
+
+when@test_cached: *monolog_test
diff --git a/tests/Application/config/packages/nyholm_psr7.yaml b/tests/Application/config/packages/nyholm_psr7.yaml
index f135723..ade8312 100644
--- a/tests/Application/config/packages/nyholm_psr7.yaml
+++ b/tests/Application/config/packages/nyholm_psr7.yaml
@@ -7,15 +7,5 @@ services:
Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory'
- # Register nyholm/psr7 services for autowiring with HTTPlug factories
- Http\Message\MessageFactory: '@nyholm.psr7.httplug_factory'
- Http\Message\RequestFactory: '@nyholm.psr7.httplug_factory'
- Http\Message\ResponseFactory: '@nyholm.psr7.httplug_factory'
- Http\Message\StreamFactory: '@nyholm.psr7.httplug_factory'
- Http\Message\UriFactory: '@nyholm.psr7.httplug_factory'
-
nyholm.psr7.psr17_factory:
class: Nyholm\Psr7\Factory\Psr17Factory
-
- nyholm.psr7.httplug_factory:
- class: Nyholm\Psr7\Factory\HttplugFactory
diff --git a/tests/Application/config/packages/prod/doctrine.yaml b/tests/Application/config/packages/prod/doctrine.yaml
deleted file mode 100644
index 2f16f0f..0000000
--- a/tests/Application/config/packages/prod/doctrine.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-doctrine:
- orm:
- metadata_cache_driver:
- type: service
- id: doctrine.system_cache_provider
- query_cache_driver:
- type: service
- id: doctrine.system_cache_provider
- result_cache_driver:
- type: service
- id: doctrine.result_cache_provider
-
-services:
- doctrine.result_cache_provider:
- class: Symfony\Component\Cache\DoctrineProvider
- public: false
- arguments:
- - '@doctrine.result_cache_pool'
- doctrine.system_cache_provider:
- class: Symfony\Component\Cache\DoctrineProvider
- public: false
- arguments:
- - '@doctrine.system_cache_pool'
-
-framework:
- cache:
- pools:
- doctrine.result_cache_pool:
- adapter: cache.app
- doctrine.system_cache_pool:
- adapter: cache.system
diff --git a/tests/Application/config/packages/prod/monolog.yaml b/tests/Application/config/packages/prod/monolog.yaml
deleted file mode 100644
index 6461211..0000000
--- a/tests/Application/config/packages/prod/monolog.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-monolog:
- handlers:
- main:
- type: fingers_crossed
- action_level: error
- handler: nested
- nested:
- type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: debug
diff --git a/tests/Application/config/packages/routing.yaml b/tests/Application/config/packages/routing.yaml
index 368bc7f..4116679 100644
--- a/tests/Application/config/packages/routing.yaml
+++ b/tests/Application/config/packages/routing.yaml
@@ -1,3 +1,3 @@
framework:
router:
- strict_requirements: ~
+ strict_requirements: true
diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml
new file mode 100644
index 0000000..e93353c
--- /dev/null
+++ b/tests/Application/config/packages/security.yaml
@@ -0,0 +1,137 @@
+security:
+ providers:
+ sylius_admin_user_provider:
+ id: sylius.admin_user_provider.email_or_name_based
+ sylius_api_admin_user_provider:
+ id: sylius.admin_user_provider.email_or_name_based
+ sylius_shop_user_provider:
+ id: sylius.shop_user_provider.email_or_name_based
+ sylius_api_shop_user_provider:
+ id: sylius.shop_user_provider.email_or_name_based
+
+ password_hashers:
+ Sylius\Component\User\Model\UserInterface: argon2i
+ firewalls:
+ admin:
+ switch_user: true
+ context: admin
+ pattern: "%sylius.security.admin_regex%"
+ provider: sylius_admin_user_provider
+ user_checker: security.user_checker.chain.admin
+ form_login:
+ provider: sylius_admin_user_provider
+ login_path: sylius_admin_login
+ check_path: sylius_admin_login_check
+ failure_path: sylius_admin_login
+ default_target_path: sylius_admin_dashboard
+ use_forward: false
+ use_referer: true
+ enable_csrf: true
+ csrf_parameter: _csrf_admin_security_token
+ csrf_token_id: admin_authenticate
+ remember_me:
+ secret: "%env(APP_SECRET)%"
+ path: "/%sylius_admin.path_name%"
+ name: APP_ADMIN_REMEMBER_ME
+ lifetime: 31536000
+ remember_me_parameter: _remember_me
+ logout:
+ path: sylius_admin_logout
+ target: sylius_admin_login
+
+ api_admin:
+ pattern: "%sylius.security.api_admin_regex%/.*"
+ provider: sylius_api_admin_user_provider
+ user_checker: security.user_checker.chain.api_admin
+ stateless: true
+ entry_point: jwt
+ json_login:
+ check_path: "%sylius.security.api_admin_route%/administrators/token"
+ username_path: email
+ password_path: password
+ success_handler: lexik_jwt_authentication.handler.authentication_success
+ failure_handler: lexik_jwt_authentication.handler.authentication_failure
+ jwt: true
+
+ api_shop:
+ pattern: "%sylius.security.api_shop_regex%/.*"
+ provider: sylius_api_shop_user_provider
+ user_checker: security.user_checker.chain.api_shop
+ stateless: true
+ entry_point: jwt
+ json_login:
+ check_path: "%sylius.security.api_shop_route%/customers/token"
+ username_path: email
+ password_path: password
+ success_handler: lexik_jwt_authentication.handler.authentication_success
+ failure_handler: lexik_jwt_authentication.handler.authentication_failure
+ jwt: true
+
+ shop:
+ switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
+ context: shop
+ pattern: "%sylius.security.shop_regex%"
+ provider: sylius_shop_user_provider
+ user_checker: security.user_checker.chain.shop
+ form_login:
+ success_handler: sylius.authentication.success_handler
+ failure_handler: sylius.authentication.failure_handler
+ provider: sylius_shop_user_provider
+ login_path: sylius_shop_login
+ check_path: sylius_shop_login_check
+ failure_path: sylius_shop_login
+ default_target_path: sylius_shop_homepage
+ use_forward: false
+ use_referer: true
+ enable_csrf: true
+ csrf_parameter: _csrf_shop_security_token
+ csrf_token_id: shop_authenticate
+ json_login:
+ check_path: sylius_shop_json_login_check
+ username_path: _username
+ password_path: _password
+ success_handler: sylius.authentication.success_handler
+ failure_handler: sylius.authentication.failure_handler
+ remember_me:
+ secret: "%env(APP_SECRET)%"
+ name: APP_SHOP_REMEMBER_ME
+ lifetime: 31536000
+ remember_me_parameter: _remember_me
+ logout:
+ path: sylius_shop_logout
+ target: sylius_shop_homepage
+ invalidate_session: false
+
+ image_resolver:
+ pattern: ^/media/cache/resolve
+ security: false
+
+ dev:
+ pattern: ^/(_(profiler|wdt)|css|images|js)/
+ security: false
+
+ access_control:
+ - { 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: 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.api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.api_admin_regex%/.*", role: ROLE_API_ACCESS }
+ - { path: "%sylius.security.api_admin_route%/administrators/token", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.api_shop_account_regex%/.*", role: ROLE_USER }
+ - { path: "%sylius.security.api_shop_route%/customers/token", role: PUBLIC_ACCESS }
+ - { path: "%sylius.security.api_shop_regex%/.*", role: PUBLIC_ACCESS }
+
+when@test: &security_test
+ security:
+ password_hashers:
+ Sylius\Component\User\Model\UserInterface: plaintext
+
+when@test_cached: *security_test
diff --git a/tests/Application/config/packages/staging/monolog.yaml b/tests/Application/config/packages/staging/monolog.yaml
deleted file mode 100644
index 6461211..0000000
--- a/tests/Application/config/packages/staging/monolog.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-monolog:
- handlers:
- main:
- type: fingers_crossed
- action_level: error
- handler: nested
- nested:
- type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: debug
diff --git a/tests/Application/config/packages/staging/swiftmailer.yaml b/tests/Application/config/packages/staging/swiftmailer.yaml
deleted file mode 100644
index f438078..0000000
--- 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/sylius_admin.yaml b/tests/Application/config/packages/sylius_admin.yaml
new file mode 100644
index 0000000..4f05227
--- /dev/null
+++ b/tests/Application/config/packages/sylius_admin.yaml
@@ -0,0 +1,6 @@
+when@test: &sylius_admin_test
+ sylius_admin:
+ notifications:
+ hub_enabled: false
+
+when@test_cached: *sylius_admin_test
diff --git a/tests/Application/config/packages/sylius_api.yaml b/tests/Application/config/packages/sylius_api.yaml
new file mode 100644
index 0000000..2bdd228
--- /dev/null
+++ b/tests/Application/config/packages/sylius_api.yaml
@@ -0,0 +1,3 @@
+when@dev:
+ sylius_api:
+ enabled: true
diff --git a/tests/Application/config/packages/sylius_channel.yaml b/tests/Application/config/packages/sylius_channel.yaml
new file mode 100644
index 0000000..940d56e
--- /dev/null
+++ b/tests/Application/config/packages/sylius_channel.yaml
@@ -0,0 +1,3 @@
+when@test_cached:
+ sylius_channel:
+ debug: true
diff --git a/tests/Application/config/packages/sylius_shop.yaml b/tests/Application/config/packages/sylius_shop.yaml
new file mode 100644
index 0000000..a3bb877
--- /dev/null
+++ b/tests/Application/config/packages/sylius_shop.yaml
@@ -0,0 +1,3 @@
+sylius_shop:
+ product_grid:
+ include_all_descendants: true
diff --git a/tests/Application/config/packages/sylius_theme.yaml b/tests/Application/config/packages/sylius_theme.yaml
new file mode 100644
index 0000000..20c8adb
--- /dev/null
+++ b/tests/Application/config/packages/sylius_theme.yaml
@@ -0,0 +1,6 @@
+when@test: &sylius_theme_test
+ sylius_theme:
+ sources:
+ test: ~
+
+when@test_cached: *sylius_theme_test
diff --git a/tests/Application/config/packages/sylius_uploader.yaml b/tests/Application/config/packages/sylius_uploader.yaml
new file mode 100644
index 0000000..bb287b8
--- /dev/null
+++ b/tests/Application/config/packages/sylius_uploader.yaml
@@ -0,0 +1,6 @@
+when@test: &sylius_uploader_test
+ services:
+ sylius.generator.image_path:
+ class: Sylius\Behat\Service\Generator\UploadedImagePathGenerator
+
+when@test_cached: *sylius_uploader_test
diff --git a/tests/Application/config/packages/test/http_client.yaml b/tests/Application/config/packages/test/http_client.yaml
deleted file mode 100644
index c75cec2..0000000
--- a/tests/Application/config/packages/test/http_client.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-framework:
- http_client:
- scoped_clients:
- tests.flux_se.sylius_payum_monetico.notify.http_client:
- base_uri: 'https://127.0.0.1:8080'
- verify_peer: false
diff --git a/tests/Application/config/packages/test/monolog.yaml b/tests/Application/config/packages/test/monolog.yaml
deleted file mode 100644
index 7e2b9e3..0000000
--- a/tests/Application/config/packages/test/monolog.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-monolog:
- handlers:
- main:
- type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: error
diff --git a/tests/Application/config/packages/test/sylius_theme.yaml b/tests/Application/config/packages/test/sylius_theme.yaml
deleted file mode 100644
index 4d34199..0000000
--- a/tests/Application/config/packages/test/sylius_theme.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-sylius_theme:
- sources:
- test: ~
diff --git a/tests/Application/config/packages/test/sylius_uploader.yaml b/tests/Application/config/packages/test/sylius_uploader.yaml
deleted file mode 100644
index ab9d6ca..0000000
--- a/tests/Application/config/packages/test/sylius_uploader.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-services:
- Sylius\Component\Core\Generator\ImagePathGeneratorInterface:
- class: Sylius\Behat\Service\Generator\UploadedImagePathGenerator
diff --git a/tests/Application/config/packages/test/web_profiler.yaml b/tests/Application/config/packages/test/web_profiler.yaml
deleted file mode 100644
index 03752de..0000000
--- a/tests/Application/config/packages/test/web_profiler.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-web_profiler:
- toolbar: false
- intercept_redirects: false
-
-framework:
- profiler: { collect: false }
diff --git a/tests/Application/config/packages/test_cached/doctrine.yaml b/tests/Application/config/packages/test_cached/doctrine.yaml
deleted file mode 100644
index 4952860..0000000
--- a/tests/Application/config/packages/test_cached/doctrine.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-doctrine:
- orm:
- entity_managers:
- default:
- result_cache_driver:
- type: memcached
- host: localhost
- port: 11211
- query_cache_driver:
- type: memcached
- host: localhost
- port: 11211
- metadata_cache_driver:
- type: memcached
- host: localhost
- port: 11211
diff --git a/tests/Application/config/packages/test_cached/fos_rest.yaml b/tests/Application/config/packages/test_cached/fos_rest.yaml
deleted file mode 100644
index 2b4189d..0000000
--- a/tests/Application/config/packages/test_cached/fos_rest.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-fos_rest:
- exception:
- debug: true
diff --git a/tests/Application/config/packages/test_cached/http_client.yaml b/tests/Application/config/packages/test_cached/http_client.yaml
deleted file mode 100644
index 9ba7c4e..0000000
--- a/tests/Application/config/packages/test_cached/http_client.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/http_client.yaml" }
diff --git a/tests/Application/config/packages/test_cached/monolog.yaml b/tests/Application/config/packages/test_cached/monolog.yaml
deleted file mode 100644
index 7e2b9e3..0000000
--- a/tests/Application/config/packages/test_cached/monolog.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-monolog:
- handlers:
- main:
- type: stream
- path: "%kernel.logs_dir%/%kernel.environment%.log"
- level: error
diff --git a/tests/Application/config/packages/test_cached/sylius_channel.yaml b/tests/Application/config/packages/test_cached/sylius_channel.yaml
deleted file mode 100644
index bab83ef..0000000
--- a/tests/Application/config/packages/test_cached/sylius_channel.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-sylius_channel:
- debug: true
diff --git a/tests/Application/config/packages/test_cached/sylius_theme.yaml b/tests/Application/config/packages/test_cached/sylius_theme.yaml
deleted file mode 100644
index 4d34199..0000000
--- a/tests/Application/config/packages/test_cached/sylius_theme.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-sylius_theme:
- sources:
- test: ~
diff --git a/tests/Application/config/packages/test_cached/sylius_uploader.yaml b/tests/Application/config/packages/test_cached/sylius_uploader.yaml
deleted file mode 100644
index cfa727e..0000000
--- a/tests/Application/config/packages/test_cached/sylius_uploader.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/sylius_uploader.yaml" }
diff --git a/tests/Application/config/packages/test_cached/twig.yaml b/tests/Application/config/packages/test_cached/twig.yaml
deleted file mode 100644
index 8c6e0b4..0000000
--- a/tests/Application/config/packages/test_cached/twig.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-twig:
- strict_variables: true
diff --git a/tests/Application/config/packages/twig.yaml b/tests/Application/config/packages/twig.yaml
index 8545473..d9e743a 100644
--- a/tests/Application/config/packages/twig.yaml
+++ b/tests/Application/config/packages/twig.yaml
@@ -10,3 +10,8 @@ services:
autoconfigure: true
Twig\Extra\Intl\IntlExtension: ~
+ Twig\Extra\String\StringExtension: ~
+
+when@test_cached:
+ twig:
+ strict_variables: true
diff --git a/tests/Application/config/packages/validator.yaml b/tests/Application/config/packages/validator.yaml
index 61807db..8ff7da1 100644
--- a/tests/Application/config/packages/validator.yaml
+++ b/tests/Application/config/packages/validator.yaml
@@ -1,3 +1,3 @@
framework:
validation:
- enable_annotations: true
+ enable_attributes: true
diff --git a/tests/Application/config/packages/web_profiler.yaml b/tests/Application/config/packages/web_profiler.yaml
new file mode 100644
index 0000000..7732441
--- /dev/null
+++ b/tests/Application/config/packages/web_profiler.yaml
@@ -0,0 +1,14 @@
+when@dev:
+ web_profiler:
+ toolbar: true
+ intercept_redirects: false
+
+when@test: &web_profiler_test
+ web_profiler:
+ toolbar: false
+ intercept_redirects: false
+
+ framework:
+ profiler: { collect: false }
+
+when@test_cached: *web_profiler_test
diff --git a/tests/Application/config/packages/webpack_encore.yaml b/tests/Application/config/packages/webpack_encore.yaml
index 9427d36..e87d4d2 100644
--- a/tests/Application/config/packages/webpack_encore.yaml
+++ b/tests/Application/config/packages/webpack_encore.yaml
@@ -1,5 +1,5 @@
webpack_encore:
- output_path: '%kernel.project_dir%/public/build/default'
- builds:
- shop: '%kernel.project_dir%/public/build/shop'
- admin: '%kernel.project_dir%/public/build/admin'
+ output_path: '%kernel.project_dir%/public/build/default'
+ builds:
+ admin: '%kernel.project_dir%/public/build/admin'
+ shop: '%kernel.project_dir%/public/build/shop'
diff --git a/tests/Application/config/parameters.yaml b/tests/Application/config/parameters.yaml
new file mode 100644
index 0000000..d1d8c7b
--- /dev/null
+++ b/tests/Application/config/parameters.yaml
@@ -0,0 +1,2 @@
+parameters:
+ locale: en_US
diff --git a/tests/Application/config/preload.php b/tests/Application/config/preload.php
new file mode 100644
index 0000000..5ebcdb2
--- /dev/null
+++ b/tests/Application/config/preload.php
@@ -0,0 +1,5 @@
+ ['all' => true],
- BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
- SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
-];
diff --git a/tests/Application/config/sylius/1.10/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.10/packages/dev/jms_serializer.yaml
deleted file mode 100644
index 2f32a9b..0000000
--- a/tests/Application/config/sylius/1.10/packages/dev/jms_serializer.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.10/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.10/packages/jms_serializer.yaml
deleted file mode 100644
index ed7bc61..0000000
--- a/tests/Application/config/sylius/1.10/packages/jms_serializer.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-jms_serializer:
- visitors:
- xml_serialization:
- format_output: '%kernel.debug%'
diff --git a/tests/Application/config/sylius/1.10/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.10/packages/prod/jms_serializer.yaml
deleted file mode 100644
index c288182..0000000
--- a/tests/Application/config/sylius/1.10/packages/prod/jms_serializer.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.10/packages/test/swiftmailer.yaml b/tests/Application/config/sylius/1.10/packages/test/swiftmailer.yaml
deleted file mode 100644
index c438f4b..0000000
--- a/tests/Application/config/sylius/1.10/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/sylius/1.10/packages/test_cached/swiftmailer.yaml b/tests/Application/config/sylius/1.10/packages/test_cached/swiftmailer.yaml
deleted file mode 100644
index 1bc61b8..0000000
--- a/tests/Application/config/sylius/1.10/packages/test_cached/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/swiftmailer.yaml" }
diff --git a/tests/Application/config/sylius/1.11/bundles.php b/tests/Application/config/sylius/1.11/bundles.php
deleted file mode 100644
index 15f3aa7..0000000
--- a/tests/Application/config/sylius/1.11/bundles.php
+++ /dev/null
@@ -1,10 +0,0 @@
- ['all' => true],
- BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
- SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
- Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
-];
diff --git a/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml
deleted file mode 100644
index 2f32a9b..0000000
--- a/tests/Application/config/sylius/1.11/packages/dev/jms_serializer.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml
deleted file mode 100644
index f438078..0000000
--- a/tests/Application/config/sylius/1.11/packages/dev/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- disable_delivery: true
diff --git a/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml
deleted file mode 100644
index ed7bc61..0000000
--- a/tests/Application/config/sylius/1.11/packages/jms_serializer.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-jms_serializer:
- visitors:
- xml_serialization:
- format_output: '%kernel.debug%'
diff --git a/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml
deleted file mode 100644
index c288182..0000000
--- a/tests/Application/config/sylius/1.11/packages/prod/jms_serializer.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml
deleted file mode 100644
index 3bab0d3..0000000
--- a/tests/Application/config/sylius/1.11/packages/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- url: '%env(MAILER_URL)%'
diff --git a/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test/swiftmailer.yaml
deleted file mode 100644
index c438f4b..0000000
--- a/tests/Application/config/sylius/1.11/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/sylius/1.11/packages/test_cached/swiftmailer.yaml b/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml
deleted file mode 100644
index 1bc61b8..0000000
--- a/tests/Application/config/sylius/1.11/packages/test_cached/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/swiftmailer.yaml" }
diff --git a/tests/Application/config/sylius/1.12/bundles.php b/tests/Application/config/sylius/1.12/bundles.php
deleted file mode 100644
index 4a8358c..0000000
--- a/tests/Application/config/sylius/1.12/bundles.php
+++ /dev/null
@@ -1,8 +0,0 @@
- ['all' => true],
- SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
- Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
- League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
-];
diff --git a/tests/Application/config/sylius/1.12/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/dev/jms_serializer.yaml
deleted file mode 100644
index 2f32a9b..0000000
--- a/tests/Application/config/sylius/1.12/packages/dev/jms_serializer.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.12/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/jms_serializer.yaml
deleted file mode 100644
index ed7bc61..0000000
--- a/tests/Application/config/sylius/1.12/packages/jms_serializer.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-jms_serializer:
- visitors:
- xml_serialization:
- format_output: '%kernel.debug%'
diff --git a/tests/Application/config/sylius/1.12/packages/mailer.yaml b/tests/Application/config/sylius/1.12/packages/mailer.yaml
deleted file mode 100644
index 0a0697c..0000000
--- a/tests/Application/config/sylius/1.12/packages/mailer.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-framework:
- mailer:
- dsn: '%env(MAILER_DSN)%'
diff --git a/tests/Application/config/sylius/1.12/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.12/packages/prod/jms_serializer.yaml
deleted file mode 100644
index c288182..0000000
--- a/tests/Application/config/sylius/1.12/packages/prod/jms_serializer.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.12/packages/test/mailer.yaml b/tests/Application/config/sylius/1.12/packages/test/mailer.yaml
deleted file mode 100644
index 52610d6..0000000
--- a/tests/Application/config/sylius/1.12/packages/test/mailer.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-framework:
- cache:
- pools:
- test.mailer_pool:
- adapter: cache.adapter.filesystem
diff --git a/tests/Application/config/sylius/1.12/packages/test_cached/mailer.yaml b/tests/Application/config/sylius/1.12/packages/test_cached/mailer.yaml
deleted file mode 100644
index 16f3170..0000000
--- a/tests/Application/config/sylius/1.12/packages/test_cached/mailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/mailer.yaml" }
diff --git a/tests/Application/config/sylius/1.9/bundles.php b/tests/Application/config/sylius/1.9/bundles.php
deleted file mode 100644
index b4f7d4a..0000000
--- a/tests/Application/config/sylius/1.9/bundles.php
+++ /dev/null
@@ -1,11 +0,0 @@
- ['all' => true],
- BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
- SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
- FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
- Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true],
-];
diff --git a/tests/Application/config/sylius/1.9/packages/_sylius.yaml b/tests/Application/config/sylius/1.9/packages/_sylius.yaml
deleted file mode 100644
index 1674a97..0000000
--- a/tests/Application/config/sylius/1.9/packages/_sylius.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
diff --git a/tests/Application/config/sylius/1.9/packages/dev/jms_serializer.yaml b/tests/Application/config/sylius/1.9/packages/dev/jms_serializer.yaml
deleted file mode 100644
index 2f32a9b..0000000
--- a/tests/Application/config/sylius/1.9/packages/dev/jms_serializer.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_PRETTY_PRINT
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.9/packages/dev/swiftmailer.yaml b/tests/Application/config/sylius/1.9/packages/dev/swiftmailer.yaml
deleted file mode 100644
index f438078..0000000
--- a/tests/Application/config/sylius/1.9/packages/dev/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- disable_delivery: true
diff --git a/tests/Application/config/sylius/1.9/packages/jms_serializer.yaml b/tests/Application/config/sylius/1.9/packages/jms_serializer.yaml
deleted file mode 100644
index ed7bc61..0000000
--- a/tests/Application/config/sylius/1.9/packages/jms_serializer.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-jms_serializer:
- visitors:
- xml_serialization:
- format_output: '%kernel.debug%'
diff --git a/tests/Application/config/sylius/1.9/packages/prod/jms_serializer.yaml b/tests/Application/config/sylius/1.9/packages/prod/jms_serializer.yaml
deleted file mode 100644
index c288182..0000000
--- a/tests/Application/config/sylius/1.9/packages/prod/jms_serializer.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-jms_serializer:
- visitors:
- json_serialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
- json_deserialization:
- options:
- - JSON_UNESCAPED_SLASHES
- - JSON_PRESERVE_ZERO_FRACTION
diff --git a/tests/Application/config/sylius/1.9/packages/swiftmailer.yaml b/tests/Application/config/sylius/1.9/packages/swiftmailer.yaml
deleted file mode 100644
index 3bab0d3..0000000
--- a/tests/Application/config/sylius/1.9/packages/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-swiftmailer:
- url: '%env(MAILER_URL)%'
diff --git a/tests/Application/config/sylius/1.9/packages/test/swiftmailer.yaml b/tests/Application/config/sylius/1.9/packages/test/swiftmailer.yaml
deleted file mode 100644
index c438f4b..0000000
--- a/tests/Application/config/sylius/1.9/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/sylius/1.9/packages/test_cached/swiftmailer.yaml b/tests/Application/config/sylius/1.9/packages/test_cached/swiftmailer.yaml
deleted file mode 100644
index 1bc61b8..0000000
--- a/tests/Application/config/sylius/1.9/packages/test_cached/swiftmailer.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/swiftmailer.yaml" }
diff --git a/tests/Application/config/sylius/1.9/routes/sylius_admin_api.yaml b/tests/Application/config/sylius/1.9/routes/sylius_admin_api.yaml
deleted file mode 100644
index 80aed45..0000000
--- a/tests/Application/config/sylius/1.9/routes/sylius_admin_api.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-sylius_admin_api:
- resource: "@SyliusAdminApiBundle/Resources/config/routing.yml"
- prefix: /api
diff --git a/tests/Application/config/symfony/5.4/packages/security.yaml b/tests/Application/config/symfony/5.4/packages/security.yaml
deleted file mode 100644
index 2821ee3..0000000
--- a/tests/Application/config/symfony/5.4/packages/security.yaml
+++ /dev/null
@@ -1,142 +0,0 @@
-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
- providers:
- sylius_admin_user_provider:
- id: sylius.admin_user_provider.email_or_name_based
- sylius_api_admin_user_provider:
- id: sylius.admin_user_provider.email_or_name_based
- sylius_shop_user_provider:
- id: sylius.shop_user_provider.email_or_name_based
- sylius_api_shop_user_provider:
- id: sylius.shop_user_provider.email_or_name_based
-
- encoders:
- Sylius\Component\User\Model\UserInterface: argon2i
- firewalls:
- admin:
- switch_user: true
- context: admin
- pattern: "%sylius.security.admin_regex%"
- provider: sylius_admin_user_provider
- form_login:
- provider: sylius_admin_user_provider
- login_path: sylius_admin_login
- check_path: sylius_admin_login_check
- failure_path: sylius_admin_login
- default_target_path: sylius_admin_dashboard
- use_forward: false
- use_referer: true
- csrf_token_generator: security.csrf.token_manager
- csrf_parameter: _csrf_admin_security_token
- csrf_token_id: admin_authenticate
- remember_me:
- secret: "%env(APP_SECRET)%"
- path: "/%sylius_admin.path_name%"
- name: APP_ADMIN_REMEMBER_ME
- lifetime: 31536000
- remember_me_parameter: _remember_me
- 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
- 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
-
- new_api_shop_user:
- pattern: "%sylius.security.new_api_shop_regex%/.*"
- provider: sylius_api_shop_user_provider
- stateless: true
- anonymous: true
- 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
-
- shop:
- switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
- context: shop
- pattern: "%sylius.security.shop_regex%"
- provider: sylius_shop_user_provider
- form_login:
- success_handler: sylius.authentication.success_handler
- failure_handler: sylius.authentication.failure_handler
- provider: sylius_shop_user_provider
- login_path: sylius_shop_login
- check_path: sylius_shop_login_check
- failure_path: sylius_shop_login
- default_target_path: sylius_shop_homepage
- use_forward: false
- use_referer: true
- csrf_token_generator: security.csrf.token_manager
- csrf_parameter: _csrf_shop_security_token
- csrf_token_id: shop_authenticate
- remember_me:
- secret: "%env(APP_SECRET)%"
- name: APP_SHOP_REMEMBER_ME
- lifetime: 31536000
- remember_me_parameter: _remember_me
- logout:
- path: sylius_shop_logout
- target: sylius_shop_login
- 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
- 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: 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: 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.shop_regex%/register", role: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: "%sylius.security.shop_regex%/verify", role: IS_AUTHENTICATED_ANONYMOUSLY }
-
- - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS }
- - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER }
-
- - { 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_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 }
diff --git a/tests/Application/config/symfony/5.4/packages/test/framework.yaml b/tests/Application/config/symfony/5.4/packages/test/framework.yaml
deleted file mode 100644
index 76d7e5e..0000000
--- a/tests/Application/config/symfony/5.4/packages/test/framework.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-framework:
- test: ~
- session:
- storage_id: session.storage.mock_file
diff --git a/tests/Application/config/symfony/5.4/packages/test_cached/framework.yaml b/tests/Application/config/symfony/5.4/packages/test_cached/framework.yaml
deleted file mode 100644
index 7c6483d..0000000
--- a/tests/Application/config/symfony/5.4/packages/test_cached/framework.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/framework.yaml" }
diff --git a/tests/Application/config/symfony/6.0/packages/security.yaml b/tests/Application/config/symfony/6.0/packages/security.yaml
deleted file mode 100644
index dbc9e1a..0000000
--- a/tests/Application/config/symfony/6.0/packages/security.yaml
+++ /dev/null
@@ -1,137 +0,0 @@
-parameters:
- sylius.security.admin_regex: "^/%sylius_admin.path_name%"
- sylius.security.api_regex: "^/api"
- sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++"
- sylius.security.new_api_route: "/new-api"
- 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%"
-
-security:
- enable_authenticator_manager: true
- providers:
- sylius_admin_user_provider:
- id: sylius.admin_user_provider.email_or_name_based
- sylius_api_admin_user_provider:
- id: sylius.admin_user_provider.email_or_name_based
- sylius_shop_user_provider:
- id: sylius.shop_user_provider.email_or_name_based
- sylius_api_shop_user_provider:
- id: sylius.shop_user_provider.email_or_name_based
- sylius_api_chain_provider:
- chain:
- providers: [ sylius_api_shop_user_provider, sylius_api_admin_user_provider ]
-
- password_hashers:
- Sylius\Component\User\Model\UserInterface: argon2i
-
- firewalls:
- admin:
- switch_user: true
- context: admin
- pattern: "%sylius.security.admin_regex%"
- provider: sylius_admin_user_provider
- form_login:
- provider: sylius_admin_user_provider
- login_path: sylius_admin_login
- check_path: sylius_admin_login_check
- failure_path: sylius_admin_login
- default_target_path: sylius_admin_dashboard
- use_forward: false
- use_referer: true
- enable_csrf: true
- csrf_parameter: _csrf_admin_security_token
- csrf_token_id: admin_authenticate
- remember_me:
- secret: "%env(APP_SECRET)%"
- path: "/%sylius_admin.path_name%"
- name: APP_ADMIN_REMEMBER_ME
- lifetime: 31536000
- remember_me_parameter: _remember_me
- logout:
- path: sylius_admin_logout
- target: sylius_admin_login
-
- new_api_admin_user:
- pattern: "%sylius.security.new_api_admin_regex%/.*"
- provider: sylius_api_admin_user_provider
- stateless: 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
- jwt: true
-
- new_api_shop_user:
- pattern: "%sylius.security.new_api_shop_regex%/.*"
- provider: sylius_api_shop_user_provider
- stateless: 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
- jwt: true
-
- shop:
- switch_user: { role: ROLE_ALLOWED_TO_SWITCH }
- context: shop
- pattern: "%sylius.security.shop_regex%"
- provider: sylius_shop_user_provider
- form_login:
- success_handler: sylius.authentication.success_handler
- failure_handler: sylius.authentication.failure_handler
- provider: sylius_shop_user_provider
- login_path: sylius_shop_login
- check_path: sylius_shop_login_check
- failure_path: sylius_shop_login
- default_target_path: sylius_shop_homepage
- use_forward: false
- use_referer: true
- enable_csrf: true
- csrf_parameter: _csrf_shop_security_token
- csrf_token_id: shop_authenticate
- remember_me:
- secret: "%env(APP_SECRET)%"
- name: APP_SHOP_REMEMBER_ME
- lifetime: 31536000
- remember_me_parameter: _remember_me
- logout:
- path: sylius_shop_logout
- target: sylius_shop_homepage
- invalidate_session: false
-
- dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
- security: false
-
- access_control:
- - { 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: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] }
- - { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS }
-
- - { 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: 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: PUBLIC_ACCESS }
- - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER }
- - { 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/symfony/6.0/packages/test/framework.yaml b/tests/Application/config/symfony/6.0/packages/test/framework.yaml
deleted file mode 100644
index 28277fd..0000000
--- a/tests/Application/config/symfony/6.0/packages/test/framework.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-framework:
- test: ~
- session:
- storage_factory_id: session.storage.factory.mock_file
diff --git a/tests/Application/config/symfony/6.0/packages/test_cached/framework.yaml b/tests/Application/config/symfony/6.0/packages/test_cached/framework.yaml
deleted file mode 100644
index 7c6483d..0000000
--- a/tests/Application/config/symfony/6.0/packages/test_cached/framework.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-imports:
- - { resource: "../test/framework.yaml" }
diff --git a/tests/Application/config/symfony/6.1 b/tests/Application/config/symfony/6.1
deleted file mode 120000
index 5049538..0000000
--- a/tests/Application/config/symfony/6.1
+++ /dev/null
@@ -1 +0,0 @@
-6.0
\ No newline at end of file
diff --git a/tests/Application/config/symfony/6.2 b/tests/Application/config/symfony/6.2
deleted file mode 120000
index 5049538..0000000
--- a/tests/Application/config/symfony/6.2
+++ /dev/null
@@ -1 +0,0 @@
-6.0
\ No newline at end of file
diff --git a/tests/Application/config/symfony/6.3 b/tests/Application/config/symfony/6.3
deleted file mode 120000
index 5049538..0000000
--- a/tests/Application/config/symfony/6.3
+++ /dev/null
@@ -1 +0,0 @@
-6.0
\ No newline at end of file
diff --git a/tests/Application/config/symfony/6.4 b/tests/Application/config/symfony/6.4
deleted file mode 120000
index 5049538..0000000
--- a/tests/Application/config/symfony/6.4
+++ /dev/null
@@ -1 +0,0 @@
-6.0
\ No newline at end of file
diff --git a/tests/Application/package.json b/tests/Application/package.json
index 7f77d97..d0538e4 100644
--- a/tests/Application/package.json
+++ b/tests/Application/package.json
@@ -1,55 +1,20 @@
{
- "dependencies": {
- "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": {
- "@babel/core": "^7.0.0",
- "@babel/eslint-parser": "^7.19.1",
- "@babel/plugin-proposal-object-rest-spread": "^7.18.9",
- "@babel/preset-env": "^7.18.10",
- "@babel/register": "^7.18.9",
- "@rollup/plugin-babel": "^6.0.3",
- "@rollup/plugin-commonjs": "^23.0.3",
- "@rollup/plugin-inject": "^5.0.2",
- "@rollup/plugin-node-resolve": "^15.0.1",
- "@semantic-ui-react/css-patch": "^1.1.2",
- "@symfony/webpack-encore": "^4.0.0",
- "babel-plugin-fast-async": "^6.1.2",
- "babel-plugin-module-resolver": "^4.1.0",
- "dedent": "^0.7.0",
- "eslint": "^8.28.0",
- "eslint-config-airbnb-base": "^15.0.0",
- "eslint-import-resolver-babel-module": "^5.3.1",
- "eslint-import-resolver-webpack": "^0.13.2",
- "eslint-plugin-import": "^2.26.0",
- "eslint-webpack-plugin": "^3.2.0",
- "fast-async": "^6.3.8",
- "merge-stream": "^2.0.0",
- "rollup": "^2.79.1",
- "rollup-plugin-terser": "^7.0.2",
- "sass": "^1.56.1",
- "sass-loader": "^13.0.0",
- "webpack": "^5.75.0",
- "webpack-cli": "^4.10.0"
- },
- "engineStrict": true,
+ "license": "MIT",
"scripts": {
- "watch": "encore dev --watch",
"build": "encore dev",
"build:prod": "encore production",
- "lint": "yarn lint:js",
- "lint:js": "eslint webpack.config.js assets/admin assets/shop",
- "postinstall": "semantic-ui-css-patch"
+ "watch": "encore dev --watch"
},
- "repository": {
- "type": "git",
- "url": "git+https://github.com/Sylius/Sylius.git"
+ "dependencies": {
+ "@sylius-ui/admin": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle",
+ "@sylius-ui/shop": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle",
+ "@symfony/ux-autocomplete": "file:../../vendor/symfony/ux-autocomplete/assets",
+ "@symfony/ux-live-component": "file:../../vendor/symfony/ux-live-component/assets"
},
- "author": "Paweł Jędrzejewski",
- "license": "MIT"
+ "devDependencies": {
+ "@hotwired/stimulus": "^3.0.0",
+ "@symfony/stimulus-bridge": "^3.2.0",
+ "@symfony/webpack-encore": "^5.0.1",
+ "tom-select": "^2.2.2"
+ }
}
diff --git a/tests/Application/public/.htaccess b/tests/Application/public/.htaccess
index 99ed00d..6d02fc2 100644
--- a/tests/Application/public/.htaccess
+++ b/tests/Application/public/.htaccess
@@ -1,25 +1,73 @@
-DirectoryIndex app.php
+# Use the front controller as index file. It serves as a fallback solution when
+# every other rewrite/redirect fails (e.g. in an aliased environment without
+# mod_rewrite). Additionally, this reduces the matching process for the
+# start page (path "/") because otherwise Apache will apply the rewriting rules
+# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
+DirectoryIndex index.php
+
+# By default, Apache does not evaluate symbolic links if you did not enable this
+# feature in your server configuration. Uncomment the following line if you
+# install assets as symlinks or if you experience problems related to symlinks
+# when compiling LESS/Sass/CoffeScript assets.
+# Options FollowSymlinks
+
+# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
+# to the front controller "/index.php" but be rewritten to "/index.php/index".
+
+ Options -MultiViews
+
RewriteEngine On
- RewriteCond %{HTTP:Authorization} ^(.*)
- RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
-
+ # Determine the RewriteBase automatically and set it as environment variable.
+ # If you are using Apache aliases to do mass virtual hosting or installed the
+ # project in a subdirectory, the base path will be prepended to allow proper
+ # resolution of the index.php file and to redirect to the correct URI. It will
+ # work in environments without path prefix as well, providing a safe, one-size
+ # fits all solution. But as you do not need it in this case, you can comment
+ # the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
+ # Sets the HTTP_AUTHORIZATION header removed by Apache
+ RewriteCond %{HTTP:Authorization} .
+ RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+
+ # Redirect to URI without front controller to prevent duplicate content
+ # (with and without `/index.php`). Only do this redirect on the initial
+ # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
+ # endless redirect loop (request -> rewrite to front controller ->
+ # redirect -> request -> ...).
+ # So in case you get a "too many redirects" error or you always get redirected
+ # to the start page because your Apache does not expose the REDIRECT_STATUS
+ # environment variable, you have 2 choices:
+ # - disable this feature by commenting the following 2 lines or
+ # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
+ # following RewriteCond (best solution)
RewriteCond %{ENV:REDIRECT_STATUS} ^$
- RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
+ RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
+ # If the requested filename exists, simply serve it.
+ # We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
- RewriteRule .? - [L]
+ RewriteRule ^ - [L]
- RewriteRule .? %{ENV:BASE}/index.php [L]
+ # Rewrite all other queries to the front controller.
+ RewriteRule ^ %{ENV:BASE}/index.php [L]
- RedirectMatch 302 ^/$ /index.php/
+ # When mod_rewrite is not available, we instruct a temporary redirect of
+ # the start page to the front controller explicitly so that the website
+ # and the generated links can still be used.
+ RedirectMatch 307 ^/$ /index.php/
+ # RedirectTemp cannot be used instead
+
+
+ # Prevent clickjacking
+ Header set X-Frame-Options SAMEORIGIN
+
diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/Layout/_logo.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/Layout/_logo.html.twig
deleted file mode 100644
index 1d9fa7d..0000000
--- a/tests/Application/templates/bundles/SyliusAdminBundle/Layout/_logo.html.twig
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig
deleted file mode 100644
index ce17621..0000000
--- a/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig
+++ /dev/null
@@ -1,6 +0,0 @@
-{% include '@SyliusUi/Security/_login.html.twig'
- with {
- 'action': path('sylius_admin_login_check'),
- 'paths': {'logo': asset('build/admin/images/logo.png', 'admin')}
-}
-%}
diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig
deleted file mode 100644
index f5f9835..0000000
--- a/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig
+++ /dev/null
@@ -1 +0,0 @@
-{{ encore_entry_script_tags('admin-entry', null, 'admin') }}
diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig
deleted file mode 100644
index a96144c..0000000
--- a/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig
+++ /dev/null
@@ -1 +0,0 @@
-{{ encore_entry_link_tags('admin-entry', null, 'admin') }}
diff --git a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/_banner.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/Homepage/_banner.html.twig
deleted file mode 100644
index 8486493..0000000
--- a/tests/Application/templates/bundles/SyliusShopBundle/Homepage/_banner.html.twig
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
{{ 'sylius.homepage.banner_content'|trans }}
-
{{ 'sylius.homepage.banner_button'|trans }}
-
-
diff --git a/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig
deleted file mode 100644
index 84b8df5..0000000
--- a/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig
deleted file mode 100644
index d1655bb..0000000
--- a/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig
+++ /dev/null
@@ -1 +0,0 @@
-{{ encore_entry_script_tags('shop-entry', null, 'shop') }}
diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig
deleted file mode 100644
index fd2c7cb..0000000
--- a/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig
+++ /dev/null
@@ -1 +0,0 @@
-{{ encore_entry_link_tags('shop-entry', null, 'shop') }}
diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js
index f07f525..f1b3c98 100644
--- a/tests/Application/webpack.config.js
+++ b/tests/Application/webpack.config.js
@@ -1,54 +1,10 @@
const path = require('path');
const Encore = require('@symfony/webpack-encore');
-const syliusBundles = path.resolve(__dirname, '../../vendor/sylius/sylius/src/Sylius/Bundle/');
-const uiBundleResources = path.resolve(syliusBundles, 'UiBundle/Resources/private/');
-const uiBundleScripts = path.resolve(uiBundleResources, 'js/');
+const SyliusAdmin = require('@sylius-ui/admin');
+const SyliusShop = require('@sylius-ui/shop');
-// Shop config
-Encore
- .setOutputPath('public/build/shop/')
- .setPublicPath('/build/shop')
- .addEntry('shop-entry', './assets/shop/entry.js')
- .disableSingleRuntimeChunk()
- .cleanupOutputBeforeBuild()
- .enableSourceMaps(!Encore.isProduction())
- .enableVersioning(Encore.isProduction())
- .enableSassLoader();
-// Disabled because it create error :
-// > 'sylius' should be listed in the project's dependencies. Run 'npm i -S sylius' to add it import/no-extraneous-dependencies
-//.enableEslintPlugin();
+const adminConfig = SyliusAdmin.getWebpackConfig(path.resolve(__dirname));
+const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname));
-const shopConfig = Encore.getWebpackConfig();
-
-shopConfig.resolve.alias['sylius/ui'] = uiBundleScripts;
-shopConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources;
-shopConfig.resolve.alias['sylius/bundle'] = syliusBundles;
-shopConfig.name = 'shop';
-
-Encore.reset();
-
-// Admin config
-Encore
- .setOutputPath('public/build/admin/')
- .setPublicPath('/build/admin')
- .addEntry('admin-entry', './assets/admin/entry.js')
- .disableSingleRuntimeChunk()
- .cleanupOutputBeforeBuild()
- .enableSourceMaps(!Encore.isProduction())
- .enableVersioning(Encore.isProduction())
- .enableSassLoader();
-// Disabled because it create error :
-// > 'sylius' should be listed in the project's dependencies. Run 'npm i -S sylius' to add it import/no-extraneous-dependencies
-// .enableEslintPlugin();
-
-const adminConfig = Encore.getWebpackConfig();
-
-adminConfig.resolve.alias['sylius/ui'] = uiBundleScripts;
-adminConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources;
-adminConfig.resolve.alias['sylius/bundle'] = syliusBundles;
-adminConfig.resolve.alias['chart.js/dist/Chart.min'] = path.resolve(__dirname, 'node_modules/chart.js/dist/chart.min.js');
-adminConfig.externals = { ...adminConfig.externals, ...{ window: 'window', document: 'document' } };
-adminConfig.name = 'admin';
-
-module.exports = [shopConfig, adminConfig];
+module.exports = [adminConfig, shopConfig];
diff --git a/tests/Behat/Context/Ui/Shop/CaptchaContext.php b/tests/Behat/Context/Ui/Shop/CaptchaContext.php
index ac70c50..e979cc6 100644
--- a/tests/Behat/Context/Ui/Shop/CaptchaContext.php
+++ b/tests/Behat/Context/Ui/Shop/CaptchaContext.php
@@ -13,9 +13,6 @@ final class CaptchaContext implements Context
/** @var PageInterface */
private $page;
- /**
- * @param PageInterface $page
- */
public function __construct(PageInterface $page)
{
$this->page = $page;
diff --git a/src/Resources/translations/messages.en.yaml b/translations/messages.en.yaml
similarity index 100%
rename from src/Resources/translations/messages.en.yaml
rename to translations/messages.en.yaml
diff --git a/src/Resources/translations/messages.fr.yaml b/translations/messages.fr.yaml
similarity index 100%
rename from src/Resources/translations/messages.fr.yaml
rename to translations/messages.fr.yaml
diff --git a/src/Resources/translations/validators.en.yaml b/translations/validators.en.yaml
similarity index 100%
rename from src/Resources/translations/validators.en.yaml
rename to translations/validators.en.yaml
diff --git a/src/Resources/translations/validators.fr.yaml b/translations/validators.fr.yaml
similarity index 100%
rename from src/Resources/translations/validators.fr.yaml
rename to translations/validators.fr.yaml