diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..81d9a54 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,32 @@ +**/*.log +**/*.md +**/*.php~ +**/._* +**/.dockerignore +**/.DS_Store +**/.git/ +**/.gitattributes +**/.github +**/.gitignore +**/.gitkeep +**/.gitmodules +**/.idea +**/Dockerfile +**/Thumbs.db +**/docker-compose*.yaml +**/docker-compose*.yml +.editorconfig +.php_cs.cache +.travis.yml +composer.phar +docker/mysql/data/ +etc/build/* +node_modules/ +var/* +vendor/ +public/assets/ +public/build/ +public/bundles/ +public/css/ +public/js/ +public/media/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec32648..4184ccc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,8 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.1", "8.2", "8.3"] - symfony: ["5.4.*", "6.4.*"] + php: ["8.2", "8.3"] + symfony: ["^6.4", "^7.1"] node: ["20.x"] mysql: ["8.0"] diff --git a/.gitignore b/.gitignore index 5cefda9..854275f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /vendor/ +/var/ /node_modules/ /composer.lock @@ -11,6 +12,7 @@ /behat.yml /phpspec.yml /phpunit.xml +/compose.override.yml .phpunit.result.cache # Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5d1ccdf --- /dev/null +++ b/Makefile @@ -0,0 +1,67 @@ +.PHONY: run + +DOCKER_COMPOSE ?= docker compose +DOCKER_USER ?= "$(shell id -u):$(shell id -g)" +ENV ?= "dev" + +init: + @make -s docker-compose-check + @if [ ! -e compose.override.yml ]; then \ + cp compose.override.dist.yml compose.override.yml; \ + fi + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php composer install --no-interaction --no-scripts --no-plugins + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm nodejs + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) up -d + +run: + @make -s up + +debug: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) -f compose.yml -f compose.override.yml -f compose.debug.yml up -d + +up: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) up -d + +down: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down + +clean: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down -v + +php-shell: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) exec php sh + +node-shell: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm -i nodejs sh + +node-watch: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm -i nodejs "npm run watch" + +docker-compose-check: + @$(DOCKER_COMPOSE) version >/dev/null 2>&1 || (echo "Please install docker compose binary or set DOCKER_COMPOSE=\"docker-compose\" for legacy binary" && exit 1) + @echo "You are using \"$(DOCKER_COMPOSE)\" binary" + @echo "Current version is \"$$($(DOCKER_COMPOSE) version)\"" + +database-init: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:create -n --if-not-exists + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:migrations:migrate -n + +database-reset: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:drop -n --force --if-exists + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:database:create -n + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console doctrine:migrations:migrate -n + +load-fixtures: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php tests/Application/bin/console sylius:fixtures:load -n + +phpstan: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/phpstan analyse -c phpstan.neon + +ecs: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/ecs check src + +phpunit: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/phpunit + +behat: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/behat diff --git a/tests/Application/assets/admin/entry.js b/assets/admin/entrypoint.js similarity index 100% rename from tests/Application/assets/admin/entry.js rename to assets/admin/entrypoint.js diff --git a/assets/shop/entrypoint.js b/assets/shop/entrypoint.js new file mode 100644 index 0000000..fd4ade3 --- /dev/null +++ b/assets/shop/entrypoint.js @@ -0,0 +1 @@ +import './js/greetings'; diff --git a/assets/shop/js/greetings.js b/assets/shop/js/greetings.js new file mode 100644 index 0000000..3d7adfd --- /dev/null +++ b/assets/shop/js/greetings.js @@ -0,0 +1,3 @@ +setTimeout(function () { + document.getElementById('greeting').innerHTML = document.getElementById('greeting').dataset.greeting; +}, 1000); diff --git a/behat.yml.dist b/behat.yml.dist index c04df8c..028e2e2 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -36,6 +36,8 @@ default: validate_certificate: false panther: panther: + options: + webServerDir: '%paths.base%/tests/Application/public' manager_options: connection_timeout_in_ms: 5000 request_timeout_in_ms: 120000 diff --git a/bin/create_node_symlink.php b/bin/create_node_symlink.php index 10d69b4..2fdd652 100644 --- a/bin/create_node_symlink.php +++ b/bin/create_node_symlink.php @@ -29,7 +29,7 @@ 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; + echo '> Failed o create the required symlink' . PHP_EOL; exit(2); } } diff --git a/compose.override.dist.yml b/compose.override.dist.yml new file mode 100644 index 0000000..e13e6f0 --- /dev/null +++ b/compose.override.dist.yml @@ -0,0 +1,72 @@ +services: + php: + image: ghcr.io/sylius/sylius-php:8.3-fixuid-xdebug-alpine + user: ${DOCKER_USER:-1000:1000} + depends_on: + mysql: + condition: service_healthy + environment: + # You can move these environment variables to your .env.local file + APP_ENV: ${ENV:-prod} + APP_SECRET: EDITME + DATABASE_URL: "mysql://root@mysql/sylius_%kernel.environment%" + MAILER_DSN: smtp://mailhog:1025 + 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:// + PHP_DATE_TIMEZONE: ${PHP_DATE_TIMEZONE:-UTC} + XDEBUG_MODE: debug + XDEBUG_CONFIG: >- + client_host=host.docker.internal + client_port=9003 + # This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers` + # Then PHPStorm will use the corresponding path mappings + PHP_IDE_CONFIG: serverName=sylius + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - .:/srv/sylius:rw,cached + # if you develop on Linux, you may use a bind-mounted host directory instead +# - ./var:/srv/sylius/var:rw + - ./public:/srv/sylius/public:rw,delegated + # if you develop on Linux, you may use a bind-mounted host directory instead +# - ./public/media:/srv/sylius/public/media:rw + - public-media:/srv/sylius/public/media:rw + mysql: + volumes: + - mysql-data:/var/lib/mysql:rw + ports: + - "3306:3306" + nginx: + environment: + WORKING_DIR: /srv/sylius/tests/Application + volumes: + - .:/srv/sylius:ro + # if you develop on Linux, you may use a bind-mounted host directory instead +# - ./public/media:/srv/sylius/public/media:ro + ports: + - "80:80" + nodejs: + image: node:${NODE_VERSION:-20}-alpine + user: ${DOCKER_USER:-1000:1000} + working_dir: /srv/sylius + entrypoint: [ "/bin/sh","-c" ] + command: + - | + cd tests/Application + yarn install + yarn build + volumes: + - .:/srv/sylius:rw,cached + - ./public:/srv/sylius/public:rw,delegated + mailhog: + ports: + - "8025:8025" + +volumes: + mysql-data: + public-media: diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..067908b --- /dev/null +++ b/compose.yml @@ -0,0 +1,22 @@ +services: + php: + image: ghcr.io/sylius/sylius-php:8.3-alpine + mysql: + image: mysql:8.4 + platform: linux/amd64 + healthcheck: + test: '/usr/bin/mysql --execute "SHOW databases;"' + timeout: 3s + interval: 1s + retries: 10 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + cap_add: + - SYS_NICE # prevent "mbind: Operation not permitted" errors + nginx: + image: ghcr.io/sylius/sylius-nginx:latest + depends_on: + - php + mailhog: + # do not use in production! + image: mailhog/mailhog:latest diff --git a/composer.json b/composer.json index b950d52..6740599 100644 --- a/composer.json +++ b/composer.json @@ -8,58 +8,60 @@ ], "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.2", "php-http/message-factory": "^1.1", - "psr/http-factory": "^1.0", - "symfony/webpack-encore-bundle": "^1.15", - "sylius/sylius": "^1.11.2 || ^1.12 || ^1.13", - "webmozart/glob": "^4.3" + "psr/http-factory": "^1.1", + "sylius/sylius": "~2.0.0", + "webmozart/glob": "^4.7" }, "require-dev": { - "behat/behat": "^3.6.1", - "behat/mink-selenium2-driver": "^1.4", - "dbrekelmans/bdi": "^1.1", - "dmore/behat-chrome-extension": "^1.3", - "dmore/chrome-mink-driver": "^2.7", - "friends-of-behat/mink": "^1.8", - "friends-of-behat/mink-browserkit-driver": "^1.4", - "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", - "friends-of-behat/symfony-extension": "^2.1", - "friends-of-behat/variadic-extension": "^1.3", - "mikey179/vfsstream": "^1.6", - "phpspec/phpspec": "^7.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.8.1", + "behat/behat": "^3.19", + "behat/mink-selenium2-driver": "^1.7", + "dbrekelmans/bdi": "^1.4", + "dmore/behat-chrome-extension": "^1.4", + "dmore/chrome-mink-driver": "^2.9.3", + "friends-of-behat/mink": "^1.11", + "friends-of-behat/mink-browserkit-driver": "^1.6.2", + "friends-of-behat/mink-debug-extension": "^2.1.0", + "friends-of-behat/mink-extension": "^2.7.5", + "friends-of-behat/page-object-extension": "^0.3.2", + "friends-of-behat/suite-settings-extension": "^1.1", + "friends-of-behat/symfony-extension": "^2.6", + "friends-of-behat/variadic-extension": "^1.6", + "mikey179/vfsstream": "^1.6.12", + "phpspec/phpspec": "^7.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.25", "phpstan/phpstan-doctrine": "1.3.69", - "phpstan/phpstan-strict-rules": "^1.3.0", - "phpstan/phpstan-webmozart-assert": "^1.2.0", - "phpunit/phpunit": "^10.5", - "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "robertfausk/behat-panther-extension": "^1.1", - "sylius-labs/coding-standard": "^4.2", + "phpstan/phpstan-strict-rules": "^1.6.2", + "phpstan/phpstan-webmozart-assert": "^1.2.11", + "phpunit/phpunit": "^10.5.46", + "polishsymfonycommunity/symfony-mocker-container": "^1.0.8", + "robertfausk/behat-panther-extension": "^1.2", + "slevomat/coding-standard": "~8.22.1", + "squizlabs/php_codesniffer": "^3.0", + "sylius-labs/coding-standard": "^4.4", "sylius-labs/suite-tags-extension": "^0.2", - "symfony/browser-kit": "^5.4 || ^6.4", - "symfony/debug-bundle": "^5.4 || ^6.4", - "symfony/dotenv": "^5.4 || ^6.4", - "symfony/flex": "^2.4", - "symfony/intl": "^5.4 || ^6.4", - "symfony/web-profiler-bundle": "^5.4 || ^6.4", - "vimeo/psalm": "^5.24" + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/debug-bundle": "^6.4 || ^7.1", + "symfony/dotenv": "^6.4 || ^7.1", + "symfony/flex": "^2.5", + "symfony/intl": "^6.4 || ^7.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.1", + "vimeo/psalm": "^5.26.1" }, "config": { "sort-packages": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": false, + "php-http/discovery": false, "phpstan/extension-installer": true, "symfony/flex": true } }, "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.2.0-dev" } }, "autoload": { @@ -89,7 +91,7 @@ "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", - "security-checker security:check": "script" + "COMPOSER_AUDIT_ABANDONED=ignore composer audit": "script" } } } diff --git a/ecs.php b/ecs.php index b76ba99..5bce4d4 100644 --- a/ecs.php +++ b/ecs.php @@ -4,7 +4,6 @@ use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer; use Symplify\EasyCodingStandard\Config\ECSConfig; -use Symplify\EasyCodingStandard\ValueObject\Option; return static function (ECSConfig $ecsConfig): void { $ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php'); diff --git a/package.json b/package.json deleted file mode 100644 index d83a414..0000000 --- a/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "devDependencies": { - "@babel/core": "^7.17.0", - "@babel/preset-env": "^7.16.0", - "@hotwired/stimulus": "^3.0.0", - "@symfony/stimulus-bridge": "^3.2.0", - "@symfony/webpack-encore": "^4.0.0", - "core-js": "^3.23.0", - "regenerator-runtime": "^0.13.9", - "webpack": "^5.74.0", - "webpack-cli": "^4.10.0", - "webpack-notifier": "^1.15.0" - }, - "license": "UNLICENSED", - "private": true, - "scripts": { - "dev-server": "encore dev-server", - "dev": "encore dev", - "watch": "encore dev --watch", - "build": "encore production --progress" - } -} diff --git a/src/Command/ServiceChangesCommand.php b/src/Command/ServiceChangesCommand.php index 586ccaf..c18b95f 100644 --- a/src/Command/ServiceChangesCommand.php +++ b/src/Command/ServiceChangesCommand.php @@ -7,6 +7,7 @@ use App\Kernel; use Symfony\Bundle\FrameworkBundle\Command\BuildDebugContainerTrait; use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -22,6 +23,7 @@ /** * @psalm-suppress PropertyNotSetInConstructor */ +#[AsCommand('webgriffe:upgrade:service-changes')] final class ServiceChangesCommand extends Command { public const FROM_VERSION_ARGUMENT_NAME = 'from'; @@ -36,8 +38,6 @@ final class ServiceChangesCommand extends Command use BuildDebugContainerTrait; - protected static $defaultName = 'webgriffe:upgrade:service-changes'; - private ?OutputInterface $output = null; private ?string $toVersion = null; @@ -354,6 +354,13 @@ private function loadInputs(InputInterface $input): void private function isSyliusService(string $decoratedServiceId): bool { return str_starts_with($decoratedServiceId, 'sylius.') || + str_starts_with($decoratedServiceId, 'sylius_admin.') || + str_starts_with($decoratedServiceId, 'sylius_api.') || + str_starts_with($decoratedServiceId, 'sylius_shop.') || + str_starts_with($decoratedServiceId, 'sylius_payum.') || + str_starts_with($decoratedServiceId, 'sylius_fixtures.') || + str_starts_with($decoratedServiceId, 'sylius_resources.') || + str_starts_with($decoratedServiceId, 'sylius_abstraction.') || str_starts_with($decoratedServiceId, 'Sylius\\') || str_starts_with($decoratedServiceId, '\\Sylius\\'); } @@ -428,6 +435,9 @@ private function applyDecoratedDefinitionsNonAppClassStrategy( } /** + * Attention! This test strategy will probably be useless in the future 'cause Sylius is not using FQCN as service + * ids anymore. + * * @param array $decoratedServicesAssociation */ private function applyAliasStrategy(array &$decoratedServicesAssociation, string $alias, string $definitionClass): bool @@ -455,8 +465,6 @@ private function applyInnerStrategy( ): bool { /** * @psalm-suppress InternalProperty - * - * @var string|null $innerServiceId */ $innerServiceId = $definition->innerServiceId; if ($innerServiceId !== null && str_contains($innerServiceId, '.inner')) { diff --git a/src/Command/TemplateChangesCommand.php b/src/Command/TemplateChangesCommand.php index ea70523..c236e4a 100644 --- a/src/Command/TemplateChangesCommand.php +++ b/src/Command/TemplateChangesCommand.php @@ -5,6 +5,7 @@ namespace Webgriffe\SyliusUpgradePlugin\Command; use const DIRECTORY_SEPARATOR; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -13,6 +14,7 @@ use Webgriffe\SyliusUpgradePlugin\Client\GitInterface; use Webmozart\Glob\Glob; +#[AsCommand('webgriffe:upgrade:template-changes')] final class TemplateChangesCommand extends Command { public const FROM_VERSION_ARGUMENT_NAME = 'from'; @@ -25,8 +27,6 @@ final class TemplateChangesCommand extends Command private const TEMPLATES_BUNDLES_SUBDIR = 'templates' . DIRECTORY_SEPARATOR . 'bundles' . DIRECTORY_SEPARATOR; - protected static $defaultName = 'webgriffe:upgrade:template-changes'; - /** @var string */ private $rootPath; diff --git a/src/DependencyInjection/Compiler/DecoratorServicePass.php b/src/DependencyInjection/Compiler/DecoratorServicePass.php index 83fb1af..81cfec3 100644 --- a/src/DependencyInjection/Compiler/DecoratorServicePass.php +++ b/src/DependencyInjection/Compiler/DecoratorServicePass.php @@ -12,6 +12,10 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\Reference; +/** + * This is a duplicate of \Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass but is keep tracks of + * decorated services in a static property to be used in tests. + */ class DecoratorServicePass extends AbstractRecursivePass { /** @var array[] */ @@ -22,8 +26,9 @@ public function process(ContainerBuilder $container) $definitions = new \SplPriorityQueue(); $order = \PHP_INT_MAX; - foreach ($container->getDefinitions() as $id => $definition) { - if (!$decorated = $definition->getDecoratedService()) { + $allDefinitions = $container->getDefinitions(); + foreach ($allDefinitions as $id => $definition) { + if (($decorated = $definition->getDecoratedService()) === null) { continue; } $definitions->insert([$id, $definition], [$decorated[2], --$order]); diff --git a/tests/Application/assets/shop/entry.js b/src/Migrations/.gitignore similarity index 100% rename from tests/Application/assets/shop/entry.js rename to src/Migrations/.gitignore diff --git a/symfony.lock b/symfony.lock deleted file mode 100644 index b61d0c6..0000000 --- a/symfony.lock +++ /dev/null @@ -1,449 +0,0 @@ -{ - "api-platform/core": { - "version": "2.7", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "2.5", - "ref": "b86557ce5677fa855b1b2608f4a4bc4a8fed8be7" - }, - "files": [ - "config/packages/api_platform.yaml", - "config/routes/api_platform.yaml", - "src/Entity/.gitignore" - ] - }, - "babdev/pagerfanta-bundle": { - "version": "v3.8.0" - }, - "doctrine/annotations": { - "version": "2.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.10", - "ref": "64d8583af5ea57b7afa4aba4b159907f3a148b05" - } - }, - "doctrine/doctrine-bundle": { - "version": "2.13", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "2.10", - "ref": "c170ded8fc587d6bd670550c43dafcf093762245" - }, - "files": [ - "config/packages/doctrine.yaml", - "src/Entity/.gitignore", - "src/Repository/.gitignore" - ] - }, - "doctrine/doctrine-migrations-bundle": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "3.1", - "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33" - }, - "files": [ - "config/packages/doctrine_migrations.yaml", - "migrations/.gitignore" - ] - }, - "friends-of-behat/symfony-extension": { - "version": "2.6", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "2.0", - "ref": "1e012e04f573524ca83795cd19df9ea690adb604" - } - }, - "friendsofsymfony/rest-bundle": { - "version": "3.7", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "3.0", - "ref": "3762cc4e4f2d6faabeca5a151b41c8c791bd96e5" - } - }, - "jms/serializer-bundle": { - "version": "4.2", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "4.0", - "ref": "cc04e10cf7171525b50c18b36004edf64cb478be" - } - }, - "knplabs/knp-gaufrette-bundle": { - "version": "v0.8.0" - }, - "knplabs/knp-menu-bundle": { - "version": "v3.4.2" - }, - "league/flysystem-bundle": { - "version": "2.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.0", - "ref": "913dc3d7a5a1af0d2b044c5ac3a16e2f851d7380" - }, - "files": [ - "config/packages/flysystem.yaml", - "var/storage/.gitignore" - ] - }, - "lexik/jwt-authentication-bundle": { - "version": "2.17", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "2.5", - "ref": "e9481b233a11ef7e15fe055a2b21fd3ac1aa2bb7" - }, - "files": [ - "config/packages/lexik_jwt_authentication.yaml" - ] - }, - "liip/imagine-bundle": { - "version": "2.13", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "1.8", - "ref": "d1227d002b70d1a1f941d91845fcd7ac7fbfc929" - } - }, - "nyholm/psr7": { - "version": "1.8", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.0", - "ref": "4a8c0345442dcca1d8a2c65633dcf0285dd5a5a2" - }, - "files": [ - "config/packages/nyholm_psr7.yaml" - ] - }, - "payum/payum-bundle": { - "version": "2.6", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "2.4", - "ref": "518ac22defa04a8a1d82479ed362e2921487adf0" - } - }, - "phpstan/phpstan": { - "version": "1.12", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "1.0", - "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" - } - }, - "phpunit/phpunit": { - "version": "10.5", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "9.6", - "ref": "7364a21d87e658eb363c5020c072ecfdc12e2326" - }, - "files": [ - ".env.test", - "phpunit.xml.dist", - "tests/bootstrap.php" - ] - }, - "sonata-project/block-bundle": { - "version": "5.1", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "4.11", - "ref": "b4edd2a1e6ac1827202f336cac2771cb529de542" - } - }, - "sonata-project/form-extensions": { - "version": "2.4", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "1.4", - "ref": "9c8a1e8ce2b1f215015ed16652c4ed18eb5867fd" - } - }, - "squizlabs/php_codesniffer": { - "version": "3.10", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "3.6", - "ref": "1019e5c08d4821cb9b77f4891f8e9c31ff20ac6f" - } - }, - "stof/doctrine-extensions-bundle": { - "version": "1.12", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "1.2", - "ref": "e805aba9eff5372e2d149a9ff56566769e22819d" - } - }, - "sylius-labs/doctrine-migrations-extra-bundle": { - "version": "v0.2.2" - }, - "sylius/calendar": { - "version": "v0.5.0" - }, - "sylius/fixtures-bundle": { - "version": "v1.9.0" - }, - "sylius/grid-bundle": { - "version": "v1.13.0" - }, - "sylius/mailer-bundle": { - "version": "v2.1.0" - }, - "sylius/resource-bundle": { - "version": "1.12", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "1.12", - "ref": "cde8dd6145be3135af63787aa5c5858c3f289c7a" - } - }, - "sylius/theme-bundle": { - "version": "v2.4.0" - }, - "symfony/console": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "5.3", - "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461" - }, - "files": [ - "bin/console" - ] - }, - "symfony/debug-bundle": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "5.3", - "ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b" - }, - "files": [ - "config/packages/debug.yaml" - ] - }, - "symfony/flex": { - "version": "2.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.0", - "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" - }, - "files": [ - ".env" - ] - }, - "symfony/framework-bundle": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.4", - "ref": "32126346f25e1cee607cc4aa6783d46034920554" - }, - "files": [ - "config/packages/cache.yaml", - "config/packages/framework.yaml", - "config/preload.php", - "config/routes/framework.yaml", - "config/services.yaml", - "public/index.php", - "src/Controller/.gitignore", - "src/Kernel.php" - ] - }, - "symfony/mailer": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "4.3", - "ref": "df66ee1f226c46f01e85c29c2f7acce0596ba35a" - }, - "files": [ - "config/packages/mailer.yaml" - ] - }, - "symfony/messenger": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.0", - "ref": "ba1ac4e919baba5644d31b57a3284d6ba12d52ee" - }, - "files": [ - "config/packages/messenger.yaml" - ] - }, - "symfony/monolog-bundle": { - "version": "3.10", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "3.7", - "ref": "aff23899c4440dd995907613c1dd709b6f59503f" - }, - "files": [ - "config/packages/monolog.yaml" - ] - }, - "symfony/panther": { - "version": "2.1", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.0", - "ref": "673836afb0eac2b0ec36c44f2ff0379e5a4b2177" - } - }, - "symfony/routing": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.2", - "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" - }, - "files": [ - "config/packages/routing.yaml", - "config/routes.yaml" - ] - }, - "symfony/security-bundle": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.4", - "ref": "2ae08430db28c8eb4476605894296c82a642028f" - }, - "files": [ - "config/packages/security.yaml", - "config/routes/security.yaml" - ] - }, - "symfony/translation": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.3", - "ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b" - }, - "files": [ - "config/packages/translation.yaml", - "translations/.gitignore" - ] - }, - "symfony/twig-bundle": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.4", - "ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877" - }, - "files": [ - "config/packages/twig.yaml", - "templates/base.html.twig" - ] - }, - "symfony/validator": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "5.3", - "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" - }, - "files": [ - "config/packages/validator.yaml" - ] - }, - "symfony/web-profiler-bundle": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "6.1", - "ref": "e42b3f0177df239add25373083a564e5ead4e13a" - }, - "files": [ - "config/packages/web_profiler.yaml", - "config/routes/web_profiler.yaml" - ] - }, - "symfony/webpack-encore-bundle": { - "version": "1.17", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "1.10", - "ref": "eff2e505d4557c967b6710fe06bd947ba555cae5" - }, - "files": [ - "assets/app.js", - "assets/bootstrap.js", - "assets/controllers.json", - "assets/controllers/hello_controller.js", - "assets/styles/app.css", - "config/packages/webpack_encore.yaml", - "package.json", - "webpack.config.js" - ] - }, - "symfony/workflow": { - "version": "6.4", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "main", - "version": "3.3", - "ref": "3b2f8ca32a07fcb00f899649053943fa3d8bbfb6" - }, - "files": [ - "config/packages/workflow.yaml" - ] - }, - "willdurand/hateoas-bundle": { - "version": "2.5", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "2.0", - "ref": "34df072c6edaa61ae19afb2f3a239f272fecab87" - } - }, - "winzou/state-machine-bundle": { - "version": "v0.6.2" - } -} diff --git a/tests/Application/.env b/tests/Application/.env index 30136c1..93ddbfe 100644 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -30,4 +30,6 @@ 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=doctrine://default?queue_name=payment_request +SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_FAILED_DSN=doctrine://default?queue_name=payment_request_failed ###< symfony/messenger ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test index c659208..56a0dbd 100644 --- a/tests/Application/.env.test +++ b/tests/Application/.env.test @@ -8,4 +8,6 @@ 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 ### diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore index bc600a8..8f00a8c 100644 --- a/tests/Application/.gitignore +++ b/tests/Application/.gitignore @@ -8,6 +8,8 @@ !/public/media/image/.gitignore /node_modules +/yarn.lock +/package-lock.json ###> symfony/framework-bundle ### /.env.*.local @@ -21,3 +23,8 @@ ###> symfony/web-server-bundle ### /.web-server-pid ###< symfony/web-server-bundle ### + +###> lexik/jwt-authentication-bundle ### +/config/jwt/*.pem +!/config/jwt/*-test.pem +###< lexik/jwt-authentication-bundle ### diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php index 19c6239..4e1f47f 100644 --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -4,94 +4,10 @@ namespace Tests\Webgriffe\SyliusUpgradePlugin\Application; -use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; -use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\Kernel as BaseKernel; -use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; 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); - } - } - - protected function configureRoutes(RoutingConfigurator $routes): void - { - foreach ($this->getConfigurationDirectories() as $confDir) { - $this->loadRoutesConfiguration($routes, $confDir); - } - } - - protected function getContainerBaseClass(): string - { - if ($this->isTestEnvironment() && class_exists(MockerContainer::class)) { - return MockerContainer::class; - } - - return parent::getContainerBaseClass(); - } - - private function isTestEnvironment(): bool - { - return 0 === strpos($this->getEnvironment(), 'test'); - } - - 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 - { - $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/entrypoint.js b/tests/Application/assets/admin/entrypoint.js new file mode 100644 index 0000000..e69de29 diff --git a/tests/Application/assets/shop/entrypoint.js b/tests/Application/assets/shop/entrypoint.js new file mode 100644 index 0000000..61b4353 --- /dev/null +++ b/tests/Application/assets/shop/entrypoint.js @@ -0,0 +1 @@ +import '../../../../assets/shop/entrypoint'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 366cbea..09f61ff 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,12 +1,11 @@ ['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], @@ -29,11 +28,6 @@ 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], @@ -45,18 +39,29 @@ Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true], Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], - Webgriffe\SyliusUpgradePlugin\WebgriffeSyliusUpgradePlugin::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], 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], + ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], + Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], - SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], - Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], + Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], + Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true], + Symfony\UX\Icons\UXIconsBundle::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\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true], + Webgriffe\SyliusUpgradePlugin\WebgriffeSyliusUpgradePlugin::class => ['all' => true], ]; + +if (class_exists(winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class)) { + $bundles[winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class] = ['all' => true]; +} + +return $bundles; diff --git a/tests/Application/config/jwt/private.pem b/tests/Application/config/jwt/private.pem deleted file mode 100644 index 2bcf023..0000000 --- a/tests/Application/config/jwt/private.pem +++ /dev/null @@ -1,54 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -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 ------END ENCRYPTED PRIVATE KEY----- diff --git a/tests/Application/config/jwt/public.pem b/tests/Application/config/jwt/public.pem deleted file mode 100644 index cb4e13d..0000000 --- a/tests/Application/config/jwt/public.pem +++ /dev/null @@ -1,14 +0,0 @@ ------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/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 58aa675..b2ba98f 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -1,10 +1,8 @@ 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" } parameters: @@ -15,4 +13,4 @@ sylius_shop: include_all_descendants: true sylius_api: - enabled: false + enabled: true diff --git a/tests/Application/config/packages/api_platform.yaml b/tests/Application/config/packages/api_platform.yaml index b428304..ceb10e7 100644 --- a/tests/Application/config/packages/api_platform.yaml +++ b/tests/Application/config/packages/api_platform.yaml @@ -1,7 +1,7 @@ api_platform: mapping: paths: - - '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_resources' + - '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_platform' - '%kernel.project_dir%/config/api_platform' - '%kernel.project_dir%/src/Entity' patch_formats: diff --git a/tests/Application/config/packages/assets.yaml b/tests/Application/config/packages/assets.yaml index 2468901..73f9d56 100644 --- a/tests/Application/config/packages/assets.yaml +++ b/tests/Application/config/packages/assets.yaml @@ -5,3 +5,7 @@ framework: json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json' admin: json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json' + app.admin: + json_manifest_path: '%kernel.project_dir%/public/build/app/admin/manifest.json' + app.shop: + json_manifest_path: '%kernel.project_dir%/public/build/app/shop/manifest.json' diff --git a/tests/Application/config/packages/dev/jms_serializer.yaml b/tests/Application/config/packages/dev/jms_serializer.yaml deleted file mode 100644 index 2f32a9b..0000000 --- a/tests/Application/config/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/packages/doctrine_migrations.yaml b/tests/Application/config/packages/doctrine_migrations.yaml index cdbc01a..ec35649 100644 --- a/tests/Application/config/packages/doctrine_migrations.yaml +++ b/tests/Application/config/packages/doctrine_migrations.yaml @@ -2,3 +2,5 @@ doctrine_migrations: storage: table_storage: table_name: sylius_migrations + migrations_paths: + 'App\Migrations': '%kernel.project_dir%/../../src/Migrations/' diff --git a/tests/Application/config/packages/fos_rest.yaml b/tests/Application/config/packages/fos_rest.yaml deleted file mode 100644 index eaebb27..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/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 8be076b..9b44501 100644 --- a/tests/Application/config/packages/framework.yaml +++ b/tests/Application/config/packages/framework.yaml @@ -4,6 +4,3 @@ framework: csrf_protection: true session: handler_id: ~ - serializer: - mapping: - paths: [ '%kernel.project_dir%/config/serialization' ] 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/jms_serializer.yaml b/tests/Application/config/packages/jms_serializer.yaml deleted file mode 100644 index ed7bc61..0000000 --- a/tests/Application/config/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/packages/prod/jms_serializer.yaml b/tests/Application/config/packages/prod/jms_serializer.yaml deleted file mode 100644 index c288182..0000000 --- a/tests/Application/config/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/packages/security.yaml b/tests/Application/config/packages/security.yaml index 4ed342f..af38e75 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -1,5 +1,4 @@ security: - enable_authenticator_manager: true providers: sylius_admin_user_provider: id: sylius.admin_user_provider.email_or_name_based @@ -18,6 +17,7 @@ security: 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 @@ -39,26 +39,28 @@ security: path: sylius_admin_logout target: sylius_admin_login - new_api_admin_user: - pattern: "%sylius.security.new_api_admin_regex%/.*" + 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.new_api_admin_route%/authentication-token" + 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 - new_api_shop_user: - pattern: "%sylius.security.new_api_shop_regex%/.*" + 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.new_api_shop_route%/authentication-token" + check_path: "%sylius.security.api_shop_route%/customers/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -70,6 +72,7 @@ security: 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 @@ -83,6 +86,12 @@ security: 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 @@ -93,19 +102,16 @@ security: target: sylius_shop_homepage invalidate_session: false - dev: - pattern: ^/(_(profiler|wdt)|css|images|js)/ - security: 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%/_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 } @@ -116,9 +122,9 @@ security: - { 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 } + - { 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 } diff --git a/tests/Application/config/packages/sylius_state_machine_abstraction.yaml b/tests/Application/config/packages/sylius_state_machine_abstraction.yaml new file mode 100644 index 0000000..7f43c0b --- /dev/null +++ b/tests/Application/config/packages/sylius_state_machine_abstraction.yaml @@ -0,0 +1,6 @@ +parameters: + test_default_state_machine_adapter: 'symfony_workflow' + test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%' + +sylius_state_machine_abstraction: + default_adapter: '%test_sylius_state_machine_adapter%' diff --git a/tests/Application/config/packages/test/framework.yaml b/tests/Application/config/packages/test/framework.yaml index fc1d3c1..e71603c 100644 --- a/tests/Application/config/packages/test/framework.yaml +++ b/tests/Application/config/packages/test/framework.yaml @@ -2,3 +2,10 @@ framework: test: ~ session: storage_factory_id: session.storage.factory.mock_file + + mailer: + dsn: '%env(MAILER_DSN)%' + cache: + pools: + test.mailer_pool: + adapter: cache.adapter.filesystem diff --git a/tests/Application/config/packages/test/mailer.yaml b/tests/Application/config/packages/test/mailer.yaml deleted file mode 100644 index 52610d6..0000000 --- a/tests/Application/config/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/packages/test/security.yaml b/tests/Application/config/packages/test/security.yaml deleted file mode 100644 index 4071d31..0000000 --- a/tests/Application/config/packages/test/security.yaml +++ /dev/null @@ -1,6 +0,0 @@ -security: - password_hashers: - Sylius\Component\User\Model\UserInterface: - algorithm: argon2i - time_cost: 3 - memory_cost: 10 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_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/mailer.yaml b/tests/Application/config/packages/test_cached/mailer.yaml deleted file mode 100644 index 16f3170..0000000 --- a/tests/Application/config/packages/test_cached/mailer.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "../test/mailer.yaml" } diff --git a/tests/Application/config/packages/test_cached/security.yaml b/tests/Application/config/packages/test_cached/security.yaml deleted file mode 100644 index 76e9273..0000000 --- a/tests/Application/config/packages/test_cached/security.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../test/security.yaml } 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/validator.yaml b/tests/Application/config/packages/validator.yaml index 61807db..a695e1a 100644 --- a/tests/Application/config/packages/validator.yaml +++ b/tests/Application/config/packages/validator.yaml @@ -1,3 +1,3 @@ framework: validation: - enable_annotations: true + email_validation_mode: html5 diff --git a/tests/Application/config/packages/webpack_encore.yaml b/tests/Application/config/packages/webpack_encore.yaml index 9bee248..23ddaa2 100644 --- a/tests/Application/config/packages/webpack_encore.yaml +++ b/tests/Application/config/packages/webpack_encore.yaml @@ -3,3 +3,5 @@ webpack_encore: builds: shop: '%kernel.project_dir%/public/build/shop' admin: '%kernel.project_dir%/public/build/admin' + app.admin: '%kernel.project_dir%/public/build/app/admin' + app.shop: '%kernel.project_dir%/public/build/app/shop' diff --git a/tests/Application/config/packages/workflow.yaml b/tests/Application/config/packages/workflow.yaml new file mode 100644 index 0000000..2a716ff --- /dev/null +++ b/tests/Application/config/packages/workflow.yaml @@ -0,0 +1,2 @@ +framework: + workflows: ~ diff --git a/tests/Application/config/routes/sylius_admin.yaml b/tests/Application/config/routes/sylius_admin.yaml index 1ba48d6..b9c12c2 100644 --- a/tests/Application/config/routes/sylius_admin.yaml +++ b/tests/Application/config/routes/sylius_admin.yaml @@ -1,3 +1,3 @@ sylius_admin: resource: "@SyliusAdminBundle/Resources/config/routing.yml" - prefix: /admin + prefix: '/%sylius_admin.path_name%' diff --git a/tests/Application/config/routes/sylius_api.yaml b/tests/Application/config/routes/sylius_api.yaml index ae01ffc..a7504e8 100644 --- a/tests/Application/config/routes/sylius_api.yaml +++ b/tests/Application/config/routes/sylius_api.yaml @@ -1,3 +1,3 @@ sylius_api: resource: "@SyliusApiBundle/Resources/config/routing.yml" - prefix: "%sylius.security.new_api_route%" + prefix: "%sylius.security.api_route%" diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index fae46cb..8e3dd42 100644 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -5,10 +5,22 @@ sylius_shop: _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" + resource: "@SyliusPayumBundle/Resources/config/routing/integrations/sylius_shop.yaml" + +sylius_payment_notify: + resource: "@SyliusPaymentBundle/Resources/config/routing/integrations/sylius.yaml" sylius_shop_default_locale: path: / methods: [GET] defaults: - _controller: sylius.controller.shop.locale_switch::switchAction + _controller: sylius_shop.controller.locale_switch::switchAction + +# see https://web.dev/change-password-url/ +sylius_shop_request_password_reset_token_redirect: + path: /.well-known/change-password + methods: [GET] + controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction + defaults: + route: sylius_shop_request_password_reset_token + permanent: false diff --git a/tests/Application/config/routes/test/routing.yaml b/tests/Application/config/routes/test/routing.yaml deleted file mode 100644 index 0ca57d9..0000000 --- a/tests/Application/config/routes/test/routing.yaml +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 0ca57d9..0000000 --- a/tests/Application/config/routes/test/sylius_test_plugin.yaml +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 0ca57d9..0000000 --- a/tests/Application/config/routes/test_cached/routing.yaml +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 0ca57d9..0000000 --- a/tests/Application/config/routes/test_cached/sylius_test_plugin.yaml +++ /dev/null @@ -1,5 +0,0 @@ -sylius_test_plugin_main: - path: /test/main - controller: FrameworkBundle:Template:template - defaults: - template: "@SyliusTestPlugin/main.html.twig" diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml index edf374b..0df0990 100644 --- a/tests/Application/config/services_test.yaml +++ b/tests/Application/config/services_test.yaml @@ -1,6 +1,6 @@ imports: - - { resource: "../../Behat/Resources/services.xml" } - { resource: "../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml" } + - { resource: "../../Behat/Resources/services.xml" } # workaround needed for strange "test.client.history" problem # see https://github.com/FriendsOfBehat/SymfonyExtension/issues/88 @@ -35,12 +35,12 @@ services: # decorate via interface webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_order_email_manager: class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateOrderEmailManagerInterface - decorates: 'Sylius\Bundle\AdminBundle\EmailManager\OrderEmailManagerInterface' + decorates: sylius.command_dispatcher.resend_order_confirmation_email # decorated BUT not changed webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_customer_unique_address_adder: class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateCustomerUniqueAddressAdder - decorates: sylius.customer_unique_address_adder + decorates: sylius.adder.customer.unique_address @@ -48,7 +48,7 @@ services: webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed.decorate_province_naming_provider: public: true class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed\DecorateProvinceNamingProvider - decorates: sylius.province_naming_provider + decorates: sylius.provider.province_naming arguments: - '@.inner' @@ -63,21 +63,16 @@ services: # decorated BUT not changed webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed.decorate_customer_order_addresses_saver: class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_decorated_definition_strategy_those_decorated_services_that_changed\DecorateCustomerOrderAddressesSaver - decorates: sylius.customer_order_addresses_saver + decorates: sylius.saver.customer.order_addresses arguments: - '@.inner' ## test_it_detects_with_alias_strategy_those_decorated_services_that_changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_decorated_services_that_changed.decorate_send_order_confirmation: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateSendOrderConfirmationHandler - decorates: Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendOrderConfirmationHandler - - # decorated BUT not changed - webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_decorated_services_that_changed.decorate_send_shipment_confirmation_email_handler: - class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateSendShipmentConfirmationEmailHandler - decorates: Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendShipmentConfirmationEmailHandler + webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_alias_strategy_those_decorated_services_that_changed.decorate_managing_price_history_context: + class: Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateManagingPriceHistoryContext + decorates: Sylius\Behat\Context\Domain\ManagingPriceHistoryContext ## test_it_alerts_about_services_whose_class_has_changed_but_not_their_alias diff --git a/tests/Application/package.json b/tests/Application/package.json index b428c24..b91df2a 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -3,11 +3,18 @@ "scripts": { "build": "encore dev", "build:prod": "encore production", - "postinstall": "semantic-ui-css-patch", - "lint": "yarn lint:js", "watch": "encore dev --watch" }, + "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" + }, "devDependencies": { - "@sylius-ui/frontend": "^1.0" + "@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/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_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 @@ -
- - Sylius logo - -
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 0d3d978..b19eb22 100644 --- a/tests/Application/webpack.config.js +++ b/tests/Application/webpack.config.js @@ -1,49 +1,48 @@ const path = require('path'); const Encore = require('@symfony/webpack-encore'); -const syliusBundles = path.resolve(__dirname, '../../vendor/sylius/sylius/src/Sylius/Bundle/'); -const uiBundleScripts = path.resolve(syliusBundles, 'UiBundle/Resources/private/js/'); -const uiBundleResources = path.resolve(syliusBundles, 'UiBundle/Resources/private/'); +const SyliusAdmin = require('@sylius-ui/admin'); +const SyliusShop = require('@sylius-ui/shop'); + +// Admin config +const adminConfig = SyliusAdmin.getWebpackConfig(path.resolve(__dirname)); // Shop config +const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname)); + +// App shop config Encore - .setOutputPath('public/build/shop/') - .setPublicPath('/build/shop') - .addEntry('shop-entry', '../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/private/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); - -const shopConfig = Encore.getWebpackConfig(); - -shopConfig.resolve.alias['sylius/ui'] = uiBundleScripts; -shopConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources; -shopConfig.resolve.alias['sylius/bundle'] = syliusBundles; -shopConfig.resolve.alias['chart.js/dist/Chart.min'] = path.resolve(__dirname, 'node_modules/chart.js/dist/chart.min.js'); -shopConfig.name = 'shop'; + .setOutputPath('public/build/app/shop') + .setPublicPath('/build/app/shop') + .addEntry('app-shop-entry', './assets/shop/entrypoint.js') + .disableSingleRuntimeChunk() + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + .enableVersioning(Encore.isProduction()) + .enableSassLoader() +; + +const appShopConfig = Encore.getWebpackConfig(); + +appShopConfig.externals = Object.assign({}, appShopConfig.externals, { window: 'window', document: 'document' }); +appShopConfig.name = 'app.shop'; Encore.reset(); -// Admin config +// App admin config Encore - .setOutputPath('public/build/admin/') - .setPublicPath('/build/admin') - .addEntry('admin-entry', '../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/Resources/private/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); - -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 = Object.assign({}, adminConfig.externals, { window: 'window', document: 'document' }); -adminConfig.name = 'admin'; - -module.exports = [shopConfig, adminConfig]; + .setOutputPath('public/build/app/admin') + .setPublicPath('/build/app/admin') + .addEntry('app-admin-entry', './assets/admin/entrypoint.js') + .disableSingleRuntimeChunk() + .cleanupOutputBeforeBuild() + .enableSourceMaps(!Encore.isProduction()) + .enableVersioning(Encore.isProduction()) + .enableSassLoader(); + +const appAdminConfig = Encore.getWebpackConfig(); + +appAdminConfig.externals = Object.assign({}, appAdminConfig.externals, { window: 'window', document: 'document' }); +appAdminConfig.name = 'app.admin'; + +module.exports = [shopConfig, adminConfig, appShopConfig, appAdminConfig]; diff --git a/tests/Integration/Command/ServiceChangesCommandTest.php b/tests/Integration/Command/ServiceChangesCommandTest.php index 8086400..4f9164a 100644 --- a/tests/Integration/Command/ServiceChangesCommandTest.php +++ b/tests/Integration/Command/ServiceChangesCommandTest.php @@ -54,8 +54,8 @@ public function test_it_detects_with_inner_substitution_strategy_those_decorated Computing modified services between 1.11.0 and 1.12.0 Found 2 services that changed and were decorated ([decorated service] -> [decorating service]): -"Sylius\Bundle\AdminBundle\EmailManager\OrderEmailManager" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateOrderEmailManagerInterface" -"Sylius\Component\Core\Cart\Context\ShopBasedCartContext" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\\test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed\DecorateNewShopBased" +"Sylius\Bundle\CoreBundle\CommandDispatcher\ResendOrderConfirmationEmailDispatcher" -> "webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_order_email_manager" +"Sylius\Component\Core\Cart\Context\ShopBasedCartContext" -> "webgriffe_sylius_upgrade.service_changes_command.test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed.decorate_new_shop_based" Found 1 services that must be checked manually because the related alias referes to a Sylius service. Actually it's impossible to detect if the original class changed between versions. Here is the list ([decorated service] -> [decorating service]): "sylius.calculator.product_variant_price" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\DecorateProductVariantPriceCalculator" @@ -96,6 +96,11 @@ public function test_it_detects_with_decorated_definition_strategy_those_decorat self::assertEquals($expectedOutput, $output); } + /** + * Attention! This test and the related strategy will probably be useless in the future 'cause + * Sylius is not using FQCN as service ids anymore. This strategy aimed at that, i kept it with + * some questionable decorated services just to keep it working. + */ public function test_it_detects_with_alias_strategy_those_decorated_services_that_changed(): void { Git::$diffToReturn = file_get_contents(self::FIXTURE_DIR . $this->name() . '/git.diff'); @@ -116,7 +121,7 @@ public function test_it_detects_with_alias_strategy_those_decorated_services_tha Computing modified services between 1.11.0 and 1.12.0 Found 1 services that changed and were decorated ([decorated service] -> [decorating service]): -"Sylius\Bundle\ApiBundle\CommandHandler\Checkout\SendOrderConfirmationHandler" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateSendOrderConfirmationHandler" +"Sylius\Behat\Context\Domain\ManagingPriceHistoryContext" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\\test_it_detects_with_alias_strategy_those_decorated_services_that_changed\DecorateManagingPriceHistoryContext" Found 1 services that must be checked manually because the related alias referes to a Sylius service. Actually it's impossible to detect if the original class changed between versions. Here is the list ([decorated service] -> [decorating service]): "sylius.calculator.product_variant_price" -> "Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\DecorateProductVariantPriceCalculator" diff --git a/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/git.diff b/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/git.diff index f20dbf5..76ec4f4 100644 --- a/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/git.diff +++ b/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/git.diff @@ -1,7 +1,7 @@ -diff --git a/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/SendOrderConfirmationHandler.php b/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/SendOrderConfirmationHandler.php +diff --git a/src/Sylius/Behat/Context/Domain/ManagingPriceHistoryContext.php b/src/Sylius/Behat/Context/Domain/ManagingPriceHistoryContext.php index 4eaff957874..60d2decf5e8 100644 ---- a/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/SendOrderConfirmationHandler.php -+++ b/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/SendOrderConfirmationHandler.php +--- a/src/Sylius/Behat/Context/Domain/ManagingPriceHistoryContext.php ++++ b/src/Sylius/Behat/Context/Domain/ManagingPriceHistoryContext.php diff --git a/src/Sylius/Bundle/AdminBundle/EmailManager/ShipmentEmailManager.php b/src/Sylius/Bundle/AdminBundle/EmailManager/ShipmentEmailManager.php index 5270cc23123..02f6b26fcf7 100644 diff --git a/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed/git.diff b/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed/git.diff index 37d763a..886548d 100644 --- a/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed/git.diff +++ b/tests/Integration/DataFixtures/Command/ServiceChangesCommandTest/test_it_detects_with_inner_substitution_strategy_those_decorated_services_that_changed/git.diff @@ -1,7 +1,7 @@ -diff --git a/src/Sylius/Bundle/AdminBundle/EmailManager/OrderEmailManager.php b/src/Sylius/Bundle/AdminBundle/EmailManager/OrderEmailManager.php +diff --git a/src/Sylius/Bundle/CoreBundle/CommandDispatcher/ResendOrderConfirmationEmailDispatcher.php b/src/Sylius/Bundle/CoreBundle/CommandDispatcher/ResendOrderConfirmationEmailDispatcher.php index 4eaff957874..60d2decf5e8 100644 ---- a/src/Sylius/Bundle/AdminBundle/EmailManager/OrderEmailManager.php -+++ b/src/Sylius/Bundle/AdminBundle/EmailManager/OrderEmailManager.php +--- a/src/Sylius/Bundle/CoreBundle/CommandDispatcher/ResendOrderConfirmationEmailDispatcher.php ++++ b/src/Sylius/Bundle/CoreBundle/CommandDispatcher/ResendOrderConfirmationEmailDispatcher.php diff --git a/src/Sylius/Bundle/AdminBundle/EmailManager/ShipmentEmailManager.php b/src/Sylius/Bundle/AdminBundle/EmailManager/ShipmentEmailManager.php index 5270cc23123..02f6b26fcf7 100644 diff --git a/tests/Stub/ServiceChangesCommand/DecorateProductVariantPriceCalculator.php b/tests/Stub/ServiceChangesCommand/DecorateProductVariantPriceCalculator.php index d1fb5aa..becc56f 100644 --- a/tests/Stub/ServiceChangesCommand/DecorateProductVariantPriceCalculator.php +++ b/tests/Stub/ServiceChangesCommand/DecorateProductVariantPriceCalculator.php @@ -18,4 +18,9 @@ public function calculateOriginal(ProductVariantInterface $productVariant, array { return 0; } + + public function calculateLowestPriceBeforeDiscount(ProductVariantInterface $productVariant, array $context): ?int + { + return 0; + } } diff --git a/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendOrderConfirmationHandler.php b/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateManagingPriceHistoryContext.php similarity index 55% rename from tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendOrderConfirmationHandler.php rename to tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateManagingPriceHistoryContext.php index ed415e9..059f8d2 100644 --- a/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendOrderConfirmationHandler.php +++ b/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateManagingPriceHistoryContext.php @@ -4,8 +4,8 @@ namespace Tests\Webgriffe\SyliusUpgradePlugin\Stub\ServiceChangesCommand\test_it_detects_with_alias_strategy_those_decorated_services_that_changed; -use Symfony\Component\Messenger\Handler\MessageHandlerInterface; +use Behat\Behat\Context\Context; -final class DecorateSendOrderConfirmationHandler implements MessageHandlerInterface +final class DecorateManagingPriceHistoryContext implements Context { } diff --git a/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendShipmentConfirmationEmailHandler.php b/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendShipmentConfirmationEmailHandler.php deleted file mode 100644 index 05e9e47..0000000 --- a/tests/Stub/ServiceChangesCommand/test_it_detects_with_alias_strategy_those_decorated_services_that_changed/DecorateSendShipmentConfirmationEmailHandler.php +++ /dev/null @@ -1,11 +0,0 @@ -