From 538915baddefb90c45740387be0ab692c42a56d9 Mon Sep 17 00:00:00 2001 From: Luca Gallinari Date: Wed, 20 Apr 2022 10:12:09 +0200 Subject: [PATCH] Upgrade to sylius 1.11 --- .github/workflows/build.yml | 8 +- .gitignore | 11 ++ bin/create_node_symlink.php | 45 +++++++ composer.json | 59 +++++---- tests/Application/.env | 18 ++- tests/Application/Kernel.php | 112 ++++++++++-------- .../config/api_platform/.gitignore | 0 tests/Application/config/bootstrap.php | 2 +- tests/Application/config/bundles.php | 8 +- tests/Application/config/jwt/private.pem | 54 +++++++++ tests/Application/config/jwt/public.pem | 14 +++ .../config/packages/jms_serializer.yaml | 4 + .../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/routes/dev/twig.yaml | 3 - .../config/routes/sylius_shop.yaml | 2 +- .../config/routes/test/routing.yaml | 5 + .../routes/test/sylius_test_plugin.yaml | 5 + .../config/routes/test_cached/routing.yaml | 5 + .../test_cached/sylius_test_plugin.yaml | 5 + .../Application/config/secrets/dev/.gitignore | 0 .../config/secrets/prod/.gitignore | 0 .../config/secrets/test/.gitignore | 0 .../config/secrets/test_cached/.gitignore | 0 .../config/serialization/.gitignore | 0 tests/Application/config/services_test.yaml | 8 ++ tests/Application/config/services_test.yml | 3 - .../config/services_test_cached.yaml | 2 + .../Application/public/media/image/.gitignore | 0 31 files changed, 293 insertions(+), 91 deletions(-) create mode 100644 bin/create_node_symlink.php rename bin/.gitkeep => tests/Application/config/api_platform/.gitignore (100%) create mode 100644 tests/Application/config/jwt/private.pem create mode 100644 tests/Application/config/jwt/public.pem create mode 100644 tests/Application/config/packages/jms_serializer.yaml 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 create mode 100644 tests/Application/config/routes/test/routing.yaml create mode 100644 tests/Application/config/routes/test/sylius_test_plugin.yaml create mode 100644 tests/Application/config/routes/test_cached/routing.yaml create mode 100644 tests/Application/config/routes/test_cached/sylius_test_plugin.yaml rename etc/build/.gitkeep => tests/Application/config/secrets/dev/.gitignore (100%) create mode 100644 tests/Application/config/secrets/prod/.gitignore create mode 100644 tests/Application/config/secrets/test/.gitignore create mode 100644 tests/Application/config/secrets/test_cached/.gitignore create mode 100644 tests/Application/config/serialization/.gitignore create mode 100644 tests/Application/config/services_test.yaml delete mode 100644 tests/Application/config/services_test.yml create mode 100644 tests/Application/config/services_test_cached.yaml create mode 100644 tests/Application/public/media/image/.gitignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3cd7ee9..604df94e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.0", "7.4"] - symfony: ["^4.4", "^5.2"] - sylius: ["~1.10.0"] - node: ["^14.17.x"] + php: ["8.0"] + symfony: ["5.4.*"] + sylius: ["^1.11"] + node: ["14.x"] mysql: ["8.0"] env: diff --git a/.gitignore b/.gitignore index 219ca6c4..a6068001 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,14 @@ /etc/build/* !/etc/build/.gitignore + +/tests/Application/yarn.lock + +/.phpunit.result.cache +/behat.yml +/phpspec.yml +/phpunit.xml + +# Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project +/.php-version +/php.ini diff --git a/bin/create_node_symlink.php b/bin/create_node_symlink.php new file mode 100644 index 00000000..10d69b45 --- /dev/null +++ b/bin/create_node_symlink.php @@ -0,0 +1,45 @@ + `' . NODE_MODULES_FOLDER_NAME . '` already exists as a link or folder, keeping existing as may be intentional.' . PHP_EOL; + exit(0); + } else { + echo '> Invalid symlink `' . NODE_MODULES_FOLDER_NAME . '` detected, recreating...' . PHP_EOL; + if (!@unlink(NODE_MODULES_FOLDER_NAME)) { + echo '> Could not delete file `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; + exit(1); + } + } +} + +/* try to create the symlink using PHP internals... */ +$success = @symlink(PATH_TO_NODE_MODULES, NODE_MODULES_FOLDER_NAME); + +/* if case it has failed, but OS is Windows... */ +if (!$success && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + /* ...then try a different approach which does not require elevated permissions and folder to exist */ + echo '> This system is running Windows, creation of links requires elevated privileges,' . PHP_EOL; + echo '> and target path to exist. Fallback to NTFS Junction:' . PHP_EOL; + exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode); + $success = $returnCode === 0; + if (!$success) { + echo '> Failed o create the required symlink' . PHP_EOL; + exit(2); + } +} + +$path = @readlink(NODE_MODULES_FOLDER_NAME); +/* check if link points to the intended directory */ +if ($path && realpath($path) === realpath(PATH_TO_NODE_MODULES)) { + echo '> Successfully created the symlink.' . PHP_EOL; + exit(0); +} + +echo '> Failed to create the symlink to `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; +exit(3); diff --git a/composer.json b/composer.json index 5dc41d14..a98880aa 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "php": "^7.4 || ^8.0", - "sylius/sylius": "~1.10.0" + "sylius/sylius": "^1.11" }, "require-dev": { "behat/behat": "^3.7", @@ -16,7 +16,7 @@ "gedmo/doctrine-extensions": "3.2.*", "friends-of-behat/mink": "^1.8", "friends-of-behat/mink-browserkit-driver": "^1.4", - "friends-of-behat/mink-debug-extension": "^2.0", + "friends-of-behat/mink-debug-extension": "^2.0.0", "friends-of-behat/mink-extension": "^2.4", "friends-of-behat/page-object-extension": "^0.3", "friends-of-behat/suite-settings-extension": "^1.0", @@ -24,31 +24,33 @@ "friends-of-behat/variadic-extension": "^1.3", "phpspec/phpspec": "^7.0", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "0.12.90", - "phpstan/phpstan-doctrine": "0.12.39", + "phpstan/phpstan": "0.12.99", + "phpstan/phpstan-doctrine": "0.12.33", "phpstan/phpstan-strict-rules": "^0.12.0", - "phpstan/phpstan-webmozart-assert": "0.12.7", - "sensiolabs/security-checker": "^6.0", + "phpstan/phpstan-webmozart-assert": "0.12.12", "phpunit/phpunit": "^9.5", - "sylius-labs/coding-standard": "^3.1", - "symfony/browser-kit": "^4.4 || ^5.2", - "symfony/debug-bundle": "^4.4 || ^5.2", - "symfony/dotenv": "^4.4 || ^5.2", - "symfony/intl": "^4.4 || ^5.2", - "symfony/web-profiler-bundle": "^4.4 || ^5.2", - "symfony/web-server-bundle": "^4.4|^5.2", + "sensiolabs/security-checker": "^6.0", + "sylius-labs/coding-standard": "^4.0", + "symfony/browser-kit": "^5.4", + "symfony/debug-bundle": "^5.4", + "symfony/dotenv": "^5.4", + "symfony/intl": "^5.4", + "symfony/web-profiler-bundle": "^5.4", "symfony/webpack-encore-bundle": "^1.12", - "vimeo/psalm": "4.4.1", + "vimeo/psalm": "4.7.1", "slevomat/coding-standard": "~6.0", - "symfony/dependency-injection": "<4.4.19 || >=5.0.0 <5.2.2" + "symfony/dependency-injection": "^5.4", + "polishsymfonycommunity/symfony-mocker-container": "^1.0" + }, + "config": { + "allow-plugins": { + "symfony/thanks": false, + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true + } }, "conflict": { - "doctrine/dbal": "^3.0", - "symfony/symfony": "4.1.8", - "symfony/browser-kit": "4.1.8", - "symfony/dom-crawler": "4.1.8", - "symfony/routing": "4.1.8", - "symfony/doctrine-bridge": "4.4.16" + "doctrine/dbal": "^3.0" }, "prefer-stable": true, "autoload": { @@ -58,6 +60,19 @@ } }, "autoload-dev": { - "classmap": ["tests/Application/Kernel.php"] + "classmap": [ + "tests/Application/Kernel.php" + ] + }, + "scripts": { + "post-install-cmd": [ + "php bin/create_node_symlink.php" + ], + "post-update-cmd": [ + "php bin/create_node_symlink.php" + ], + "post-create-project-cmd": [ + "php bin/create_node_symlink.php" + ] } } diff --git a/tests/Application/.env b/tests/Application/.env index 8e4c038c..fe7af284 100755 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -15,6 +15,12 @@ APP_SECRET=EDITME DATABASE_URL=mysql://root@127.0.0.1/sylius_wish_list_plugin_%kernel.environment%?serverVersion=5.7 ###< doctrine/doctrine-bundle ### +###> 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 +###< 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=" @@ -22,9 +28,9 @@ DATABASE_URL=mysql://root@127.0.0.1/sylius_wish_list_plugin_%kernel.environment% MAILER_URL=smtp://localhost ###< symfony/swiftmailer-bundle ### - -###> 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=YOUR_SECRET_PASSPHRASE -###< lexik/jwt-authentication-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 ### diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index 697b0cc8..cb75cbed 100755 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -5,24 +5,14 @@ namespace Tests\BitBag\SyliusWishlistPlugin\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,66 +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'); - $loader->load($confDir . '/{api_resources}/*' . 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); - $resolver = new LoaderResolver([ - 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/bin/.gitkeep b/tests/Application/config/api_platform/.gitignore similarity index 100% rename from bin/.gitkeep rename to tests/Application/config/api_platform/.gitignore diff --git a/tests/Application/config/bootstrap.php b/tests/Application/config/bootstrap.php index 2291ab42..d7ac51d8 100644 --- a/tests/Application/config/bootstrap.php +++ b/tests/Application/config/bootstrap.php @@ -15,7 +15,7 @@ throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); } else { // load all the .env files - (new Dotenv())->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'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 4805d174..3ea398b6 100755 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -41,23 +41,23 @@ 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], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Sylius\Bundle\ApiBundle\SyliusApiBundle::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], - Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => 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], Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], + Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], BitBag\SyliusWishlistPlugin\BitBagSyliusWishlistPlugin::class => ['all' => true], + BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/jwt/private.pem b/tests/Application/config/jwt/private.pem new file mode 100644 index 00000000..2bcf0230 --- /dev/null +++ b/tests/Application/config/jwt/private.pem @@ -0,0 +1,54 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIJrTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIDbthk+aF5EACAggA +MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBA3DYfh2mXByUxFNke/Wf5SBIIJ +UBckIgXeXBWPLQAAq07pN8uNFMUcUirFuEvbmxVe1PupCCAqriNxi1DqeSu/M7c1 +h66y0BqKZu/0G9SVTg63iCKDEiRAM3hLyD2CsjYg8h2LAaqQ9dFYGV0cHRhCXagZ +Sdt9YTfn2rarRbxauMSt0z9zwCaiUrBU4JwSM3g+tD7W0lxAm9TeaqBZek5DIX+j +3Gom5tPYQe8jvfGMGdMPuanoEwH4WbWzGcqypWriy4JwaggwKCQ4ituWfa9kqMMC +8HRmBBDg0gtafmQP910RZh18JL2ewF5Pl7GDsLtOj5gNLNuAiQxDCcYRnD4/Cdsl +bH91btmGX1nUVIFViUTW93eBsjBgdgqOMRVxUKkSSX6CmIZWlE3AazgwSbvOvNrN +JGa8X21UwfuS/JHLmfRmgdti0YxRjJkBYLPpcd3ILsi+MMhSHy0uycAM/dB80Q1B +vkW1UXGbCw/PzA5yHrzULzAl69E3Tt5nTVMIIcBGxw2rf+ej+AVjsuOl7etwecdC +gnA90ViNlGOACLVnhsjd4WVF9Oircosf0UYoblwcT6gw1GSVF9pWuu7k5hy/7Pt/ +o1BvonUgz/4VHG+K58qvtnlto+J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c +g8ITX8bJ/GH+M6JdP7tLCikDTSGS+i1ReMQXE5XuEajYOVbzQdyWU5jleZIx0f6X +mTa4WvMEGNyNxKZZXsy9FAaBkZqrNzEv8k0uFgFMNWQcMMtiqbei86yACdqe+jiW +HqHv8wfoBHR+eIARub2itOJ/cI+oKv96d4it4FqQ9Lml8RUFFZj7Hrd6EjDb6Nq4 +P9ti7eku/xZvS0saBNChvv44GhP6FZJS0i/gidVffLna7Wua98tPZEAXp57k+XUL +PzsRJ4a+hFuQjkyXFoz/v8YuUdyCFUSVVr9ArVu0v4+4euFWpQLav5sXv0Gh9X58 +Ek1KIf7Z/tZAJnSjTjFuSbDX/AoTMTxpRBKKnFW6zY0Nw2pjTVMtTVDkv9xkBpBK +wod7FPD5f0T7y9YOARVZnBxVRSkkcYpEJFy5pLNeadg9 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/tests/Application/config/jwt/public.pem b/tests/Application/config/jwt/public.pem new file mode 100644 index 00000000..cb4e13da --- /dev/null +++ b/tests/Application/config/jwt/public.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA6QkmF/Xi5nAYb8Kzr7qC +d63V2K+d/nCXbpDUKKDPJAqOtTlMoQSuJRLNnhhp7z1i/Cp4Bhifr20Pu2dq8JYg +6pRT4ctqvYb/MXxAaPZc3EcBC0S6AhgKO/fDvR3LcqYqGJmQQOXZvxTsgqongdvV +4XbqFBMMgngyayoBk0VKTaI/s+LQhIce+1QaxbAI0+/zbR0hZ1hWT73orJi3do+1 +TBzQol+V7WGa8LlJfmgM56qO3BmVkeTDMBc27pGp6g3+Oufk/l29jEGJlUT9yu7Q +BRhaQTWNVASa2aD+AKjVBzJh53O2zD8slAbjF1M9U7bbWN28Sv+xC/dUz0q9HnPu +RsY2tnwryqTyYn/Hf2xyP3/KvjJ6oslAwemu5JirdJkO7KVQAthWG42gLuhZg3ks +cSZhCLZH7nO2UDsf+2ZZgdbhpYZwR4gDRfNt7GKWXnWZOz9Uw1yVCPgylyZRZwg8 +l0y9aABdj3379I22icrwpMZbAgkyxNSV6UNJuxZksLUoP3i9OvXYgPYU9E4tU/Ul +Dm/T1rGSReGoPkU1YQnI50bq7p1byIoUu2scTflvpTVI5a7zULkS1tg60xk7vBRC +aBc7nr4UEtA235N6uLtcGxH11WBMwsKX69sSU0sQdC4Sk25zXM2gc8R1XV9K3qz2 +wQorQRlCwrkG44VRDgbFH+8CAwEAAQ== +-----END PUBLIC KEY----- diff --git a/tests/Application/config/packages/jms_serializer.yaml b/tests/Application/config/packages/jms_serializer.yaml new file mode 100644 index 00000000..ed7bc613 --- /dev/null +++ b/tests/Application/config/packages/jms_serializer.yaml @@ -0,0 +1,4 @@ +jms_serializer: + visitors: + xml_serialization: + format_output: '%kernel.debug%' diff --git a/tests/Application/config/packages/test/security.yaml b/tests/Application/config/packages/test/security.yaml new file mode 100644 index 00000000..21cc3772 --- /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 00000000..ab9d6ca0 --- /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 00000000..21cc3772 --- /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 00000000..cfa727e2 --- /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/routes/dev/twig.yaml b/tests/Application/config/routes/dev/twig.yaml deleted file mode 100755 index bcbbf13d..00000000 --- a/tests/Application/config/routes/dev/twig.yaml +++ /dev/null @@ -1,3 +0,0 @@ -_errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 8818568b..92eeae0c 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/routes/test/routing.yaml b/tests/Application/config/routes/test/routing.yaml new file mode 100644 index 00000000..0ca57d9a --- /dev/null +++ b/tests/Application/config/routes/test/routing.yaml @@ -0,0 +1,5 @@ +sylius_test_plugin_main: + path: /test/main + controller: FrameworkBundle:Template:template + defaults: + template: "@SyliusTestPlugin/main.html.twig" diff --git a/tests/Application/config/routes/test/sylius_test_plugin.yaml b/tests/Application/config/routes/test/sylius_test_plugin.yaml new file mode 100644 index 00000000..0ca57d9a --- /dev/null +++ b/tests/Application/config/routes/test/sylius_test_plugin.yaml @@ -0,0 +1,5 @@ +sylius_test_plugin_main: + path: /test/main + controller: FrameworkBundle:Template:template + defaults: + template: "@SyliusTestPlugin/main.html.twig" diff --git a/tests/Application/config/routes/test_cached/routing.yaml b/tests/Application/config/routes/test_cached/routing.yaml new file mode 100644 index 00000000..0ca57d9a --- /dev/null +++ b/tests/Application/config/routes/test_cached/routing.yaml @@ -0,0 +1,5 @@ +sylius_test_plugin_main: + path: /test/main + controller: FrameworkBundle:Template:template + defaults: + template: "@SyliusTestPlugin/main.html.twig" diff --git a/tests/Application/config/routes/test_cached/sylius_test_plugin.yaml b/tests/Application/config/routes/test_cached/sylius_test_plugin.yaml new file mode 100644 index 00000000..0ca57d9a --- /dev/null +++ b/tests/Application/config/routes/test_cached/sylius_test_plugin.yaml @@ -0,0 +1,5 @@ +sylius_test_plugin_main: + path: /test/main + controller: FrameworkBundle:Template:template + defaults: + template: "@SyliusTestPlugin/main.html.twig" diff --git a/etc/build/.gitkeep b/tests/Application/config/secrets/dev/.gitignore similarity index 100% rename from etc/build/.gitkeep rename to tests/Application/config/secrets/dev/.gitignore diff --git a/tests/Application/config/secrets/prod/.gitignore b/tests/Application/config/secrets/prod/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/tests/Application/config/secrets/test/.gitignore b/tests/Application/config/secrets/test/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/tests/Application/config/secrets/test_cached/.gitignore b/tests/Application/config/secrets/test_cached/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/tests/Application/config/serialization/.gitignore b/tests/Application/config/serialization/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml new file mode 100644 index 00000000..9edf553d --- /dev/null +++ b/tests/Application/config/services_test.yaml @@ -0,0 +1,8 @@ +imports: + - { resource: "../../Behat/Resources/services.yml" } + - { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } + +# workaround needed for strange "test.client.history" problem +# see https://github.com/FriendsOfBehat/SymfonyExtension/issues/88 +services: + Symfony\Component\BrowserKit\AbstractBrowser: '@test.client' diff --git a/tests/Application/config/services_test.yml b/tests/Application/config/services_test.yml deleted file mode 100644 index a925faa1..00000000 --- a/tests/Application/config/services_test.yml +++ /dev/null @@ -1,3 +0,0 @@ -imports: - - { resource: "../../Behat/Resources/services.yml" } - - { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } diff --git a/tests/Application/config/services_test_cached.yaml b/tests/Application/config/services_test_cached.yaml new file mode 100644 index 00000000..0de380ea --- /dev/null +++ b/tests/Application/config/services_test_cached.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: "services_test.yaml" } diff --git a/tests/Application/public/media/image/.gitignore b/tests/Application/public/media/image/.gitignore new file mode 100644 index 00000000..e69de29b