From a9cac6fb9e2c32f64388e65e9d8f0bd9e278b696 Mon Sep 17 00:00:00 2001 From: Luca Gallinari Date: Fri, 9 Sep 2022 11:25:45 +0200 Subject: [PATCH] Aligns with PluginSkeleton by updating to Sylius 1.11 and PHP 8.0 --- .github/workflows/build.yaml | 40 +++---- composer.json | 47 ++++---- easy-coding-standard.yml | 9 -- ecs.php | 14 +++ tests/Application/.env | 7 ++ tests/Application/Kernel.php | 111 ++++++++++-------- tests/Application/config/bootstrap.php | 8 +- tests/Application/config/bundles.php | 5 +- .../Application/config/packages/_sylius.yaml | 1 - .../Application/config/packages/fos_rest.yaml | 2 +- .../config/packages/framework.yaml | 4 +- .../Application/config/packages/security.yaml | 29 ++--- .../config/packages/test/security.yaml | 3 + .../config/packages/test/sylius_uploader.yaml | 3 + .../config/packages/test_cached/security.yaml | 3 + .../packages/test_cached/sylius_uploader.yaml | 2 + tests/Application/config/packages/twig.yaml | 8 ++ tests/Application/config/routes/dev/twig.yaml | 3 - .../config/routes/sylius_admin_api.yaml | 3 - .../config/routes/sylius_shop.yaml | 2 +- .../config/serialization/.gitignore | 0 tests/Application/public/index.php | 4 +- .../Application/public/media/image/.gitignore | 0 23 files changed, 173 insertions(+), 135 deletions(-) delete mode 100644 easy-coding-standard.yml create mode 100644 ecs.php create mode 100644 tests/Application/config/packages/test/security.yaml create mode 100644 tests/Application/config/packages/test/sylius_uploader.yaml create mode 100644 tests/Application/config/packages/test_cached/security.yaml create mode 100644 tests/Application/config/packages/test_cached/sylius_uploader.yaml delete mode 100755 tests/Application/config/routes/dev/twig.yaml delete mode 100755 tests/Application/config/routes/sylius_admin_api.yaml create mode 100644 tests/Application/config/serialization/.gitignore mode change 100755 => 100644 tests/Application/public/media/image/.gitignore diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dc7c482..24187d9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,8 +21,7 @@ jobs: strategy: matrix: php-version: - - "7.3" - - "7.4" + - "8.0" dependencies: - "highest" @@ -37,10 +36,10 @@ jobs: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" @@ -67,7 +66,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "highest" @@ -82,10 +81,10 @@ jobs: coverage: "none" extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - tools: "composer:v1, composer-require-checker, composer-unused" + tools: "composer, composer-require-checker, composer-unused" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" @@ -103,8 +102,7 @@ jobs: strategy: matrix: php-version: - - "7.3" - - "7.4" + - "8.0" dependencies: - "highest" @@ -119,10 +117,10 @@ jobs: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" @@ -137,8 +135,7 @@ jobs: strategy: matrix: php-version: - - "7.3" - - "7.4" + - "8.0" dependencies: - "lowest" @@ -154,10 +151,10 @@ jobs: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" @@ -175,8 +172,7 @@ jobs: strategy: matrix: php-version: - - "7.3" - - "7.4" + - "8.0" dependencies: - "highest" @@ -194,10 +190,10 @@ jobs: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" @@ -220,7 +216,7 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.0" dependencies: - "highest" @@ -235,13 +231,13 @@ jobs: coverage: "pcov" extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - tools: "composer:v1" + tools: "composer" - name: "Set up problem matchers for phpunit/phpunit" run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.dependencies }}" diff --git a/composer.json b/composer.json index aa42d6b..40b1f87 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ ], "license": "MIT", "require": { - "php": "^7.3", + "php": "^8.0", + "sylius/sylius": "^1.11", "ext-json": "*", "ext-mbstring": "*", "doctrine/doctrine-bundle": "^1.12.12 || ^2.0", @@ -23,20 +24,20 @@ "setono/doctrine-orm-batcher": "^0.6.2", "setono/doctrine-orm-batcher-bundle": "^0.3.1", "sylius/resource-bundle": "^1.6", - "symfony/cache": "^4.4 || ^5.0", - "symfony/config": "^4.4 || ^5.0", - "symfony/console": "^4.4 || ^5.0", - "symfony/dependency-injection": "^4.4 || ^5.0", - "symfony/event-dispatcher": "^4.4 || ^5.0", - "symfony/form": "^4.4 || ^5.0", - "symfony/http-foundation": "^4.4 || ^5.0", - "symfony/lock": "^4.4 || ^5.0", - "symfony/messenger": "^4.4 || ^5.0", - "symfony/options-resolver": "^4.4 || ^5.0", - "symfony/routing": "^4.4 || ^5.0", + "symfony/cache": "^5.4", + "symfony/config": "^5.4", + "symfony/console": "^5.4", + "symfony/dependency-injection": "^5.4", + "symfony/event-dispatcher": "^5.4", + "symfony/form": "^5.4", + "symfony/http-foundation": "^5.4", + "symfony/lock": "^5.4", + "symfony/messenger": "^5.4", + "symfony/options-resolver": "^5.4", + "symfony/routing": "^5.4", "symfony/translation-contracts": "^1.0 || ^2.0", - "symfony/validator": "^4.4 || ^5.0", - "symfony/workflow": "^4.4 || ^5.0", + "symfony/validator": "^5.4", + "symfony/workflow": "^5.4", "thecodingmachine/safe": "^1.1", "twig/twig": "^2.0 || ^3.0", "webmozart/assert": "^1.1" @@ -47,14 +48,20 @@ "phpunit/phpunit": "^9.4", "roave/security-advisories": "dev-master", "setono/code-quality-pack": "^1.1", - "sylius/sylius": "~1.9.0", - "symfony/debug-bundle": "^5.1", - "symfony/dotenv": "^5.1", - "symfony/intl": "^4.4 || ^5.0", - "symfony/web-profiler-bundle": "^4.4 || ^5.0" + "symfony/debug-bundle": "^5.4", + "symfony/dotenv": "^5.4", + "symfony/framework-bundle": "^5.4", + "symfony/intl": "^5.4", + "symfony/web-profiler-bundle": "^5.4" }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, + "phpstan/extension-installer": true, + "symfony/thanks": true + } }, "extra": { "branch-alias": { diff --git a/easy-coding-standard.yml b/easy-coding-standard.yml deleted file mode 100644 index 81f401c..0000000 --- a/easy-coding-standard.yml +++ /dev/null @@ -1,9 +0,0 @@ -imports: - - { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' } - -services: - PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer: ~ - -parameters: - exclude_files: - - '**/tests/Application/**' diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..bf40cc9 --- /dev/null +++ b/ecs.php @@ -0,0 +1,14 @@ +import('vendor/sylius-labs/coding-standard/ecs.php'); + + $containerConfigurator->parameters()->set(Option::SKIP, [ + VisibilityRequiredFixer::class => ['*Spec.php'], + ]); +}; diff --git a/tests/Application/.env b/tests/Application/.env index 180a1d9..9ce8fc7 100755 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -22,6 +22,13 @@ DATABASE_URL=mysql://root@127.0.0.1/setono_sylius_mailchimp_%kernel.environment% MAILER_URL=smtp://localhost ###< symfony/swiftmailer-bundle ### +###> symfony/messenger ### +# Choose one of the transports below +# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages +MESSENGER_TRANSPORT_DSN=doctrine://default +# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages +###< symfony/messenger ### + ###> setono/sylius-mailchimp-plugin ### # Get it from https://us4.admin.mailchimp.com/account/api/ MAILCHIMP_API_KEY= diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index 7ad1acc..c47c99e 100755 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -5,24 +5,14 @@ namespace Tests\Setono\SyliusMailchimpPlugin\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\DelegatingLoader; use Symfony\Component\Config\Loader\LoaderInterface; -use Symfony\Component\Config\Loader\LoaderResolver; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\DependencyInjection\Loader\ClosureLoader; -use Symfony\Component\DependencyInjection\Loader\DirectoryLoader; -use Symfony\Component\DependencyInjection\Loader\GlobFileLoader; -use Symfony\Component\DependencyInjection\Loader\IniFileLoader; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\HttpKernel\Config\FileLocator; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\RouteCollectionBuilder; -use Webmozart\Assert\Assert; final class Kernel extends BaseKernel { @@ -42,65 +32,94 @@ public function getLogDir(): string public function registerBundles(): iterable { - $contents = require $this->getProjectDir() . '/config/bundles.php'; - foreach ($contents as $class => $envs) { - if (isset($envs['all']) || isset($envs[$this->environment])) { - yield new $class(); + foreach ($this->getConfigurationDirectories() as $confDir) { + $bundlesFile = $confDir . '/bundles.php'; + if (false === is_file($bundlesFile)) { + continue; } + yield from $this->registerBundlesFromFile($bundlesFile); } } protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { - $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); + 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); - $confDir = $this->getProjectDir() . '/config'; - $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'); + foreach ($this->getConfigurationDirectories() as $confDir) { + $this->loadContainerConfiguration($loader, $confDir); + } } protected function configureRoutes(RouteCollectionBuilder $routes): void { - $confDir = $this->getProjectDir() . '/config'; - - $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); + foreach ($this->getConfigurationDirectories() as $confDir) { + $this->loadRoutesConfiguration($routes, $confDir); + } } protected function getContainerBaseClass(): string { - if ($this->isTestEnvironment()) { + if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) { return MockerContainer::class; } return parent::getContainerBaseClass(); } - protected function getContainerLoader(ContainerInterface $container): LoaderInterface + private function isTestEnvironment(): bool { - /** @var ContainerBuilder $container */ - Assert::isInstanceOf($container, ContainerBuilder::class); - - $locator = new FileLocator($this, $this->getRootDir() . '/Resources'); - $resolver = new LoaderResolver(array( - new XmlFileLoader($container, $locator), - new YamlFileLoader($container, $locator), - new IniFileLoader($container, $locator), - new PhpFileLoader($container, $locator), - new GlobFileLoader($container, $locator), - new DirectoryLoader($container, $locator), - new ClosureLoader($container), - )); - - return new DelegatingLoader($resolver); + return 0 === strpos($this->getEnvironment(), 'test'); } - private function isTestEnvironment(): bool + private function loadContainerConfiguration(LoaderInterface $loader, string $confDir): void { - return 0 === strpos($this->getEnvironment(), 'test'); + $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(RouteCollectionBuilder $routes, string $confDir): void + { + $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); + } + + /** + * @return BundleInterface[] + */ + private function registerBundlesFromFile(string $bundlesFile): iterable + { + $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/config/bootstrap.php b/tests/Application/config/bootstrap.php index 8ea2af2..e23eca0 100755 --- a/tests/Application/config/bootstrap.php +++ b/tests/Application/config/bootstrap.php @@ -1,21 +1,23 @@ =1.2) -if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { +if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { $_SERVER += $env; $_ENV += $env; } elseif (!class_exists(Dotenv::class)) { throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); } else { // load all the .env files - (new Dotenv(true))->loadEnv(dirname(__DIR__).'/.env'); + (new Dotenv(true))->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 acaae0e..c489d24 100755 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -40,17 +40,16 @@ 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], Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true], Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], - FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true], - Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true], Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], + BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], + Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 238cec5..8df2f88 100755 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -2,7 +2,6 @@ imports: - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" } - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } diff --git a/tests/Application/config/packages/fos_rest.yaml b/tests/Application/config/packages/fos_rest.yaml index a72eef7..eaebb27 100755 --- a/tests/Application/config/packages/fos_rest.yaml +++ b/tests/Application/config/packages/fos_rest.yaml @@ -7,5 +7,5 @@ fos_rest: empty_content: 204 format_listener: rules: - - { path: '^/api/.*', priorities: ['json', 'xml'], fallback_format: json, prefer_extension: true } + - { path: '^/api/v1/.*', 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 e74ed81..8be076b 100755 --- a/tests/Application/config/packages/framework.yaml +++ b/tests/Application/config/packages/framework.yaml @@ -2,6 +2,8 @@ framework: secret: '%env(APP_SECRET)%' form: true csrf_protection: true - templating: { engines: ["twig"] } session: handler_id: ~ + serializer: + mapping: + paths: [ '%kernel.project_dir%/config/serialization' ] diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index 830b03d..96342da 100755 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -1,16 +1,12 @@ -parameters: - sylius.security.admin_regex: "^/admin" - sylius.security.api_regex: "^/api" - sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++" - security: + always_authenticate_before_granting: true providers: sylius_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 encoders: - Sylius\Component\User\Model\UserInterface: sha512 + Sylius\Component\User\Model\UserInterface: argon2i firewalls: admin: switch_user: true @@ -30,7 +26,7 @@ security: csrf_token_id: admin_authenticate remember_me: secret: "%env(APP_SECRET)%" - path: /admin + path: "/%sylius_admin.path_name%" name: APP_ADMIN_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me @@ -39,17 +35,6 @@ security: target: sylius_admin_login anonymous: true - oauth_token: - pattern: "%sylius.security.api_regex%/oauth/v2/token" - security: false - - api: - pattern: "%sylius.security.api_regex%/.*" - provider: sylius_admin_user_provider - fos_oauth: true - stateless: true - anonymous: true - shop: switch_user: { role: ROLE_ALLOWED_TO_SWITCH } context: shop @@ -81,7 +66,11 @@ security: anonymous: true dev: - pattern: ^/(_(profiler|wdt)|css|images|js)/ + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + + image_resolver: + pattern: ^/media/cache/resolve security: false access_control: @@ -91,12 +80,10 @@ security: - { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS } - { path: "%sylius.security.admin_regex%/login", role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: "%sylius.security.api_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.api_regex%/.*", role: ROLE_API_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } diff --git a/tests/Application/config/packages/test/security.yaml b/tests/Application/config/packages/test/security.yaml new file mode 100644 index 0000000..21cc377 --- /dev/null +++ b/tests/Application/config/packages/test/security.yaml @@ -0,0 +1,3 @@ +security: + encoders: + sha512: sha512 diff --git a/tests/Application/config/packages/test/sylius_uploader.yaml b/tests/Application/config/packages/test/sylius_uploader.yaml new file mode 100644 index 0000000..ab9d6ca --- /dev/null +++ b/tests/Application/config/packages/test/sylius_uploader.yaml @@ -0,0 +1,3 @@ +services: + Sylius\Component\Core\Generator\ImagePathGeneratorInterface: + class: Sylius\Behat\Service\Generator\UploadedImagePathGenerator diff --git a/tests/Application/config/packages/test_cached/security.yaml b/tests/Application/config/packages/test_cached/security.yaml new file mode 100644 index 0000000..21cc377 --- /dev/null +++ b/tests/Application/config/packages/test_cached/security.yaml @@ -0,0 +1,3 @@ +security: + encoders: + sha512: sha512 diff --git a/tests/Application/config/packages/test_cached/sylius_uploader.yaml b/tests/Application/config/packages/test_cached/sylius_uploader.yaml new file mode 100644 index 0000000..cfa727e --- /dev/null +++ b/tests/Application/config/packages/test_cached/sylius_uploader.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "../test/sylius_uploader.yaml" } diff --git a/tests/Application/config/packages/twig.yaml b/tests/Application/config/packages/twig.yaml index 3b315dc..8545473 100755 --- a/tests/Application/config/packages/twig.yaml +++ b/tests/Application/config/packages/twig.yaml @@ -2,3 +2,11 @@ twig: paths: ['%kernel.project_dir%/templates'] debug: '%kernel.debug%' strict_variables: '%kernel.debug%' + +services: + _defaults: + public: false + autowire: true + autoconfigure: true + + Twig\Extra\Intl\IntlExtension: ~ diff --git a/tests/Application/config/routes/dev/twig.yaml b/tests/Application/config/routes/dev/twig.yaml deleted file mode 100755 index f4ee839..0000000 --- a/tests/Application/config/routes/dev/twig.yaml +++ /dev/null @@ -1,3 +0,0 @@ -_errors: - resource: '@TwigBundle/Resources/config/routing/errors.xml' - prefix: /_error diff --git a/tests/Application/config/routes/sylius_admin_api.yaml b/tests/Application/config/routes/sylius_admin_api.yaml deleted file mode 100755 index 80aed45..0000000 --- a/tests/Application/config/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/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 8818568..92eeae0 100755 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -2,7 +2,7 @@ sylius_shop: resource: "@SyliusShopBundle/Resources/config/routing.yml" prefix: /{_locale} requirements: - _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ + _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ sylius_shop_payum: resource: "@SyliusShopBundle/Resources/config/routing/payum.yml" diff --git a/tests/Application/config/serialization/.gitignore b/tests/Application/config/serialization/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php index bb19e79..7480be7 100755 --- a/tests/Application/public/index.php +++ b/tests/Application/public/index.php @@ -1,7 +1,9 @@