diff --git a/.docker/nginx/nginx.conf b/.docker/nginx/nginx.conf deleted file mode 100644 index 6bfbd29..0000000 --- a/.docker/nginx/nginx.conf +++ /dev/null @@ -1,48 +0,0 @@ -user www-data; -worker_processes auto; -daemon off; -pid /run/nginx.pid; - -include /etc/nginx/modules-enabled/*.conf; - -events { - worker_connections 1024; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - server_tokens off; - - client_max_body_size 64m; - sendfile on; - tcp_nodelay on; - tcp_nopush on; - - gzip_vary on; - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - server { - listen 80; - - root /app/tests/Application/public; - index index.php; - - location / { - try_files $uri /index.php$is_args$args; - } - - location ~ \.php$ { - include fastcgi_params; - - fastcgi_pass unix:/var/run/php8-fpm.sock; - fastcgi_split_path_info ^(.+\.php)(/.*)$; - - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; - fastcgi_param DOCUMENT_ROOT $realpath_root; - } - } -} diff --git a/.docker/php/php.ini b/.docker/php/php.ini deleted file mode 100644 index 13f0abe..0000000 --- a/.docker/php/php.ini +++ /dev/null @@ -1,5 +0,0 @@ -[PHP] -memory_limit=512M - -[date] -date.timezone=${PHP_DATE_TIMEZONE} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 92faea2..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @Sylius/core-team diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..825a82a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG] - " +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here as the version of the plugin used. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00cd4c4..4c4e3ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,19 +21,20 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.1", "8.2", "8.3"] - symfony: ["5.4.*", "^6.0"] - sylius: ["^1.12.0", "^1.13.1"] - node: ["18.x"] - mysql: ["8.0"] + php: ["8.4"] + symfony: ["^7.3"] + sylius: ["~2.2.0"] + node: ["22.x"] + mysql: ["8.4"] env: APP_ENV: test + BEHAT_BASE_URL: "https://127.0.0.1:8080/" DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" steps: - - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP @@ -66,21 +67,13 @@ jobs: run: php -v | head -n 1 | awk '{ print $2 }' > .php-version - - name: Install certificates - run: symfony server:ca:install - - - - name: Run Chrome Headless - run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & - - - - name: Run webserver - run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon) + name: Validate composer.json + run: composer validate --ansi --strict - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer @@ -91,16 +84,12 @@ jobs: restore-keys: | ${{ runner.os }}-php-${{ matrix.php }}-composer- - - - name: Configure global composer - run: | - composer global config --no-plugins allow-plugins.symfony/flex true - composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.2.2" - - name: Restrict Symfony version if: matrix.symfony != '' run: | + composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.4" + composer global config --no-plugins allow-plugins.symfony/flex true composer config extra.symfony.require "${{ matrix.symfony }}" - @@ -111,13 +100,35 @@ jobs: - name: Install PHP dependencies run: composer install --no-interaction - env: - SYMFONY_REQUIRE: ${{ matrix.symfony }} + + - + name: Validate container + run: vendor/bin/console lint:container + + - + name: Run ECS + run: vendor/bin/ecs check + + - + name: Run PHPStan + run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ + + - + name: Run Psalm + run: vendor/bin/psalm + + - + name: Run PHPSpec + run: vendor/bin/phpspec run --ansi -f progress --no-interaction + + - + name: Run unit tests + run: vendor/bin/phpunit --colors=always --testsuite=unit - name: Get Yarn cache directory id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Cache Yarn @@ -130,51 +141,47 @@ jobs: - name: Install JS dependencies - run: (cd tests/Application && yarn install) + run: (cd vendor/sylius/test-application && yarn install) - name: Prepare test application database run: | - (cd tests/Application && bin/console doctrine:database:create -vvv) - (cd tests/Application && bin/console doctrine:schema:create -vvv) + (vendor/bin/console doctrine:database:create -vvv) + (vendor/bin/console doctrine:schema:create -vvv) + + - + name: Validate database schema + run: vendor/bin/console doctrine:schema:validate - name: Prepare test application assets run: | - (cd tests/Application && bin/console assets:install public -vvv) - (cd tests/Application && yarn build:prod) + vendor/bin/console assets:install -vvv + (cd vendor/sylius/test-application && yarn build) - name: Prepare test application cache - run: (cd tests/Application && bin/console cache:warmup -vvv) + run: vendor/bin/console cache:warmup -vvv - name: Load fixtures in test application - run: (cd tests/Application && bin/console sylius:fixtures:load -n) + run: vendor/bin/console sylius:fixtures:load -n - - name: Validate composer.json - run: composer validate --ansi --strict + name: Run Non-unit PHPUnit tests + run: vendor/bin/phpunit --colors=always --testsuite=non-unit - - name: Validate database schema - run: (cd tests/Application && bin/console doctrine:schema:validate) - - - - name: Run PHPStan - run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ - - - - name: Run Psalm - run: vendor/bin/psalm + name: Install certificates + run: symfony server:ca:install || true - - name: Run PHPSpec - run: vendor/bin/phpspec run --ansi -f progress --no-interaction + name: Run Chrome Headless + run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & - - name: Run PHPUnit - run: vendor/bin/phpunit --colors=always + name: Run webserver + run: symfony server:start --port=8080 --daemon - name: Run Behat @@ -185,6 +192,34 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: Behat logs + name: "Behat logs - ${{ matrix.sylius }}-${{ github.run_id }}-${{ github.run_number }}" path: etc/build/ if-no-files-found: ignore + compression-level: 6 + overwrite: true + + roave_bc_check: + name: Roave BC Check + runs-on: ubuntu-latest + env: + PHP_VERSION: 8.4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ env.PHP_VERSION }}" + extensions: intl + tools: flex,symfony + coverage: none + + - name: Install roave/backward-compatibility-check. + run: composer require --dev roave/backward-compatibility-check --no-plugins + + - name: Run roave/backward-compatibility-check. + run: vendor/bin/roave-backward-compatibility-check --format=github-actions + diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 0000000..6af9b15 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,22 @@ +name: Automatic Rebase +on: + issue_comment: + types: [ created ] +jobs: + rebase: + name: Rebase + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') + runs-on: ubuntu-latest + steps: + - + name: Checkout the latest code + uses: actions/checkout@v2 + with: + token: ${{ secrets.PAT_TOKEN }} + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + + - + name: Automatic Rebase + uses: cirrus-actions/rebase@1.4 + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.gitignore b/.gitignore index 29046b9..4f8e12d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,23 @@ /vendor/ +/var/ /node_modules/ +/drivers/ /composer.lock /etc/build/* !/etc/build/.gitignore -/tests/Application/yarn.lock - /.phpunit.result.cache /behat.yml /phpspec.yml /phpunit.xml +/compose.override.yml +/docker-compose.override.yml +.phpunit.result.cache # Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project /.php-version /php.ini + +/tests/TestApplication/.env.local +/tests/TestApplication/.env.*.local diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c98527d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,116 @@ +# Code of Conduct - CustomerReorderPlugin + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to make participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, +threatening, offensive, or harmful. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will +communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at . +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version +[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and +[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md), +and was generated by [contributing-gen](https://github.com/bttger/contributing-gen). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..69fb39d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,136 @@ + +# Contributing to CustomerReorderPlugin + +First off, thanks for taking the time to contribute! ❤️ + +All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 + +> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +> - Star the project +> - Tweet about it +> - Refer this project in your project's readme +> - Mention the project at local meetups and tell your friends/colleagues + + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [I Have a Question](#i-have-a-question) +- [I Want To Contribute](#i-want-to-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Suggesting Enhancements](#suggesting-enhancements) + - [Your First Code Contribution](#your-first-code-contribution) + - [Improving The Documentation](#improving-the-documentation) +- [Styleguides](#styleguides) + - [Commit Messages](#commit-messages) +- [Join The Project Team](#join-the-project-team) + + +## Code of Conduct + +This project and everyone participating in it is governed by the +[CustomerReorderPlugin Code of Conduct](https://github.com/webgriffe/CustomerReorderPlugin/master/CODE_OF_CONDUCT.md). +By participating, you are expected to uphold this code. Please report unacceptable behavior +to . + + +## I Have a Question + +> If you want to ask a question, we assume that you have read the available [Documentation](https://github.com/webgriffe/CustomerReorderPlugin/docs). + +Before you ask a question, it is best to search for existing [Issues](https://github.com/webgriffe/CustomerReorderPlugin/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification, we recommend the following: + +- Open an [Issue](https://github.com/webgriffe/CustomerReorderPlugin/issues/new). +- Provide as much context as you can about what you're running into. +- Provide project and platform versions (sylius, symfony, etc), depending on what seems relevant. + +We will then take care of the issue as soon as possible. + +## I Want To Contribute + +> ### Legal Notice +> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. + +### Reporting Bugs + + +#### Before Submitting a Bug Report + +A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. + +- Make sure that you are using the latest version. +- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://github.com/webgriffe/CustomerReorderPlugin/docs). If you are looking for support, you might want to check [this section](#i-have-a-question)). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/webgriffe/CustomerReorderPlugin/issues?q=label%3Abug). +- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. +- Collect information about the bug: + - Stack trace (Traceback) + - OS, Platform and Version (Windows, Linux, macOS, Sylius, Symfony) + - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. + - Possibly your input and the output + - Can you reliably reproduce the issue? And can you also reproduce it with older versions? + + +#### How Do I Submit a Good Bug Report? + +> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . + + +We use GitHub issues to track bugs and errors. If you run into an issue with the project: + +- Open an [Issue](https://github.com/webgriffe/CustomerReorderPlugin/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D+-+). +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. +- Provide the information you collected in the previous section. + +Once it's filed: + +- The project team will label the issue accordingly. +- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). + + + + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for CustomerReorderPlugin, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. + + +#### Before Submitting an Enhancement + +- Make sure that you are using the latest version. +- Read the [documentation](https://github.com/webgriffe/CustomerReorderPlugin/docs) carefully and find out if the functionality is already covered, maybe by an individual configuration. +- Perform a [search](https://github.com/webgriffe/CustomerReorderPlugin/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. + + +#### How Do I Submit a Good Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://github.com/webgriffe/CustomerReorderPlugin/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=). + +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. +- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. +- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +- **Explain why this enhancement would be useful** to most CustomerReorderPlugin users. You may also want to point out the other projects that solved it better and which could serve as inspiration. + + + +### Your First Code Contribution +Have a look at the [Contributing documentation](https://github.com/webgriffe/CustomerReorderPlugin/blob/master/docs/04-Contributing.md). + +### Improving The Documentation +If your change changes anything in the documentation, or needs to be added, we ask you to do so directly in the PR of the change. + +## Styleguides +### Commit Messages +We write our commit message as starting with "This commit will...". Use english language. If you are working on a issue or a PR, please add the (#N) where N stands for the number of the issue/PR to help users find more about your commit scope. + +[//]: # (## Join The Project Team) + + + +## Attribution +This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! diff --git a/Makefile b/Makefile index 01d9607..0b57e25 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,67 @@ -phpunit: - vendor/bin/phpunit +.PHONY: run -phpspec: - vendor/bin/phpspec run --ansi --no-interaction -f dot +DOCKER_COMPOSE ?= docker compose +DOCKER_USER ?= "$(shell id -u):$(shell id -g)" +ENV ?= "dev" -phpstan: - vendor/bin/phpstan analyse +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 -psalm: - vendor/bin/psalm +run: + @make -s up -behat-js: - APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress +debug: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) -f compose.yml -f compose.override.yml -f compose.debug.yml up -d -install: - composer install --no-interaction --no-scripts +up: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) up -d -backend: - tests/Application/bin/console sylius:install --no-interaction - tests/Application/bin/console sylius:fixtures:load default --no-interaction +down: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down -frontend: - (cd tests/Application && yarn install --pure-lockfile) - (cd tests/Application && GULP_ENV=prod yarn build) +clean: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) down -v -behat: - APP_ENV=test vendor/bin/behat --colors --strict --no-interaction -vvv -f progress +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)\"" -init: install backend frontend +database-init: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console doctrine:database:create -n --if-not-exists + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console doctrine:migrations:migrate -n -ci: init phpstan psalm phpunit phpspec behat +database-reset: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console doctrine:database:drop -n --force --if-exists + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console doctrine:database:create -n + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console doctrine:migrations:migrate -n -integration: init phpunit behat +load-fixtures: + @ENV=$(ENV) DOCKER_USER=$(DOCKER_USER) $(DOCKER_COMPOSE) run --rm php vendor/bin/console sylius:fixtures:load -n -static: install phpspec phpstan psalm +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=root $(DOCKER_COMPOSE) run --rm php vendor/bin/behat diff --git a/README.md b/README.md index 39cdaad..535e13b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ > :warning: **BEWARE!** -> This repository has been deprecated and will not be maintained or evolved by the Sylius Team. You can still use it with compatible Sylius versions, but at your own risk, as no bugs will be fixed on it. +> This repository has been forked from the [official repository](https://github.com/Sylius/CustomerReorderPlugin) because it has been deprecated and will not be maintained or evolved by the Sylius Team.

- + + +
+
+ +

@@ -26,19 +30,33 @@ Once the Reorder process is completed, the newly created Order is listed in the ## Installation -#### Beware! +1. Run `composer require webgriffe/sylius-customer-reorder-plugin`: it's normal that the "cache:clear" command, that is executed automatically at the end, fails because you have to do the next steps. -> This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the -[legacy installation instruction](docs/legacy_installation.md). However, we strongly encourage you to use -Symfony Flex, it's much quicker! :) +2. If they have not been added automatically, you have to add these bundles to `config/bundles.php` file: -To install plugin, just require it with composer: + ```php + Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin::class => ['all' => true], + ``` -```bash -composer require sylius/customer-reorder-plugin -``` +3. Add the plugin's configs by creating the file `config/packages/webriffe_sylius_customer_reorder_plugin.yaml` with the following content: + + ```yaml + imports: + - { resource: "@SyliusCustomerReorderPlugin/config/config.yaml" } + ``` + +4. Add the plugin's routes by creating the file `config/routes/webgriffe_sylius_customer_reorder_plugin.yaml` with the following content: + + ```yaml + sylius_customer_reorder_plugin: + resource: "@SyliusCustomerReorderPlugin/config/app_routing.yaml" + ``` -> Remember to allow community recipes with `composer config extra.symfony.allow-contrib true` or during plugin installation process +5. Clear cache: + + ```bash + bin/console cache:clear + ``` ## Extension points @@ -67,7 +85,104 @@ Adding `Reorder` action required extending order-related behaviours in `config.y You can read much more about Resources here: -## Security issues -If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly. -Instead, all security issues must be sent to `security@sylius.com`. +## Contributing + +To contribute you need to: + +1. Clone this repository into you development environment and go to the plugin's root directory, + +2. Then, from the plugin's root directory, run the following commands: + + ```bash + composer install + ``` + +3. Copy `tests/TestApplication/.env` in `tests/TestApplication/.env.local` and set configuration specific for your development environment. + +4. Link node_modules: + + ```bash + ln -s vendor/sylius/test-application/node_modules node_modules + ``` + +5. Run docker (create a `compose.override.yml` if you need to customize services): + + ```bash + docker-compose up -d + ``` + +6. Then, from the plugin's root directory, run the following commands: + + ```bash + composer test-app-init + ``` + +7. Run your local server: + + ```bash + symfony server:ca:install + symfony server:start -d + ``` + +8. Now at http://localhost:8080/ you have a full Sylius testing application which runs the plugin + +### Static checks + + - Coding Standard + ```bash + vendor/bin/ecs check --fix + ``` + + - Psalm + + ```bash + vendor/bin/psalm + ``` + + - PHPStan + + ```bash + vendor/bin/phpstan analyse + ``` + +### Testing + +After your changes you must ensure that the tests are still passing. + +First setup your test database: + +```bash +APP_ENV=test vendor/bin/console doctrine:database:create +APP_ENV=test vendor/bin/console doctrine:migrations:migrate -n +# Optionally load data fixtures +APP_ENV=test vendor/bin/console sylius:fixtures:load -n +``` + +And build assets: + +```bash +(cd vendor/sylius/test-application && yarn install) +(cd vendor/sylius/test-application && yarn build) +vendor/bin/console assets:install +``` + +The current CI suite runs the following tests: + +- PHPUnit + + ```bash + vendor/bin/phpunit + ``` + +- PHPSpec + + ```bash + vendor/bin/phpspec run + ``` + +- Behat + + ```bash + vendor/bin/behat --strict + ``` diff --git a/assets/admin/controllers.json b/assets/admin/controllers.json new file mode 100644 index 0000000..e2ce9b5 --- /dev/null +++ b/assets/admin/controllers.json @@ -0,0 +1,4 @@ +{ + "controllers": [], + "entrypoints": [] +} diff --git a/tests/Application/config/api_platform/.gitignore b/assets/admin/entrypoint.js similarity index 100% rename from tests/Application/config/api_platform/.gitignore rename to assets/admin/entrypoint.js diff --git a/assets/shop/controllers.json b/assets/shop/controllers.json new file mode 100644 index 0000000..e2ce9b5 --- /dev/null +++ b/assets/shop/controllers.json @@ -0,0 +1,4 @@ +{ + "controllers": [], + "entrypoints": [] +} diff --git a/tests/Application/config/secrets/dev/.gitignore b/assets/shop/entrypoint.js similarity index 100% rename from tests/Application/config/secrets/dev/.gitignore rename to assets/shop/entrypoint.js diff --git a/behat.yml.dist b/behat.yml.dist index 164b7a6..d95adf9 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -11,7 +11,6 @@ default: extensions: DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~ - Robertfausk\Behat\PantherExtension: ~ FriendsOfBehat\MinkDebugExtension: directory: etc/build @@ -20,7 +19,7 @@ default: Behat\MinkExtension: files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" - base_url: "https://127.0.0.1:8080/" + base_url: "%env(BEHAT_BASE_URL)%" default_session: symfony javascript_session: chromedriver sessions: @@ -34,24 +33,13 @@ default: chrome: api_url: http://127.0.0.1:9222 validate_certificate: false - panther: - panther: - manager_options: - connection_timeout_in_ms: 5000 - request_timeout_in_ms: 120000 - chromedriver_arguments: - - --log-path=etc/build/chromedriver.log - - --verbose - capabilities: - acceptSslCerts: true - acceptInsecureCerts: true - unexpectedAlertBehaviour: accept show_auto: false FriendsOfBehat\SymfonyExtension: - bootstrap: tests/Application/config/bootstrap.php + bootstrap: vendor/sylius/test-application/config/bootstrap.php kernel: - class: Tests\Sylius\CustomerReorderPlugin\Application\Kernel + class: Sylius\TestApplication\Kernel + environment: test FriendsOfBehat\VariadicExtension: ~ diff --git a/bin/console b/bin/console new file mode 120000 index 0000000..46e506e --- /dev/null +++ b/bin/console @@ -0,0 +1 @@ +../vendor/bin/console \ No newline at end of file diff --git a/bin/create_console_symlink.php b/bin/create_console_symlink.php new file mode 100644 index 0000000..9dbf03c --- /dev/null +++ b/bin/create_console_symlink.php @@ -0,0 +1,53 @@ + {$targetRelativeFromBin}"); +} + +@chmod($linkPath, 0755); +info("Created symlink: bin/console -> {$targetRelativeFromBin}"); diff --git a/bin/create_node_symlink.php b/bin/create_node_symlink.php deleted file mode 100644 index 10d69b4..0000000 --- a/bin/create_node_symlink.php +++ /dev/null @@ -1,45 +0,0 @@ - `' . 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/compose.yml b/compose.yml new file mode 100644 index 0000000..441b0df --- /dev/null +++ b/compose.yml @@ -0,0 +1,29 @@ +services: + php: + image: ghcr.io/sylius/sylius-php:8.4-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 + ports: + - ${MYSQL_PORT:-3306}:3306 + volumes: + - sylius-customer-reorder-plugin-mysql-data:/var/lib/mysql:rw + nginx: + image: ghcr.io/sylius/sylius-nginx:latest + depends_on: + - php + mailhog: + # do not use in production! + image: axllent/mailpit:latest + +volumes: + sylius-customer-reorder-plugin-mysql-data: diff --git a/composer.json b/composer.json index b21df17..6fb062f 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,12 @@ { - "name": "sylius/customer-reorder-plugin", + "name": "webgriffe/customer-reorder-plugin", "type": "sylius-plugin", "description": "Sylius plugin that enables order reordering for a customer", "authors": [ + { + "name": "Webgriffe SRL", + "homepage": "https://github.com/webgriffe/" + }, { "name": "Bartosz Pietrzak", "homepage": "https://github.com/bartoszpietrzak1994" @@ -11,88 +15,122 @@ "keywords": [ "sylius", "sylius-plugin", - "symfony", - "e-commerce", - "customer reorder" + "test-appication" ], "license": "MIT", "require": { - "php": "^8.1", - "sylius/sylius": "^1.12", - "symfony/http-foundation": "^5.4 || ^6.0", - "symfony/webpack-encore-bundle": "^1.15" + "php": "^8.2", + "sylius/sylius": "^2.0", + "symfony/lock": "^6.4 || ^7.1", + "webmozart/assert": "^1.9" }, "require-dev": { - "behat/behat": "^3.6.1", - "behat/mink-selenium2-driver": "^1.6", - "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", + "behat/behat": "^3.16", + "behat/mink": "^1.13", + "behat/mink-selenium2-driver": "^1.7", + "dbrekelmans/bdi": "^1.4", + "dmore/behat-chrome-extension": "^1.4", + "dmore/chrome-mink-driver": "^2.9", + "friends-of-behat/mink-browserkit-driver": "^1.6", + "friends-of-behat/mink-debug-extension": "^2.1", + "friends-of-behat/mink-extension": "^2.7", "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", - "phpspec/phpspec": "^7.2", + "friends-of-behat/suite-settings-extension": "^1.1", + "friends-of-behat/symfony-extension": "^2.6", + "friends-of-behat/variadic-extension": "^1.6", + "phpspec/phpspec": "^8.0", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.8.1", - "phpstan/phpstan-doctrine": "1.3.16", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-doctrine": "^1.3", "phpstan/phpstan-strict-rules": "^1.3.0", - "phpstan/phpstan-webmozart-assert": "^1.2.0", - "phpunit/phpunit": "^9.6 || ^10.5", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^10.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "robertfausk/behat-panther-extension": "^1.1", - "sylius-labs/coding-standard": "^4.2", - "sylius-labs/suite-tags-extension": "^0.2", - "symfony/browser-kit": "^5.4 || ^6.0", - "symfony/debug-bundle": "^5.4 || ^6.0", - "symfony/dotenv": "^5.4 || ^6.0", - "symfony/flex": "^2.2.2", - "symfony/intl": "^5.4 || ^6.0", - "symfony/web-profiler-bundle": "^5.4 || ^6.0", - "vimeo/psalm": "^4.27" + "psalm/plugin-symfony": "^5.2", + "rector/rector": "^1.0", + "sylius-labs/coding-standard": "^4.4", + "sylius-labs/suite-tags-extension": "~0.2", + "sylius/sylius-rector": "^2.0", + "sylius/test-application": "^2.0.0@alpha", + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/debug-bundle": "^6.4 || ^7.1", + "symfony/dotenv": "^6.4 || ^7.1", + "symfony/http-client": "^6.4 || ^7.1", + "symfony/intl": "^6.4 || ^7.1", + "symfony/runtime": "^6.4 || ^7.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.1", + "symfony/webpack-encore-bundle": "^2.2", + "vimeo/psalm": "^6.13" }, "config": { "sort-packages": true, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": false, + "php-http/discovery": false, "phpstan/extension-installer": true, - "symfony/flex": true + "symfony/flex": true, + "symfony/runtime": true } }, "extra": { "branch-alias": { - "dev-master": "1.12-dev" - } + "dev-master": "2.0-dev" + }, + "symfony": { + "require": "^7.3" + }, + "public-dir": "vendor/sylius/test-application/public" }, "autoload": { "psr-4": { - "Sylius\\CustomerReorderPlugin\\": "src/", - "Tests\\Sylius\\CustomerReorderPlugin\\": "tests/" + "Sylius\\CustomerReorderPlugin\\": "src/" } }, "autoload-dev": { - "classmap": [ - "tests/Application/Kernel.php" - ] + "psr-4": { + "Tests\\Sylius\\CustomerReorderPlugin\\": ["tests/", "tests/TestApplication/src/"] + } }, "scripts": { - "post-install-cmd": [ - "php bin/create_node_symlink.php" + "database-reset": [ + "vendor/bin/console doctrine:database:drop --force --if-exists", + "vendor/bin/console doctrine:database:create", + "vendor/bin/console doctrine:migration:migrate -n", + "vendor/bin/console sylius:fixtures:load -n" ], - "post-update-cmd": [ - "php bin/create_node_symlink.php" + "frontend-clear": [ + "cd vendor/sylius/test-application && yarn install && yarn build", + "vendor/bin/console assets:install" ], - "post-create-project-cmd": [ - "php bin/create_node_symlink.php" + "test-app-init": [ + "@database-reset", + "@frontend-clear" + ], + "ecs": "ecs", + "phpstan": "phpstan analyse", + "psalm": "psalm --no-cache", + "phpunit": "phpunit", + "phpspec": "phpspec run", + "behat": "behat --strict -vvv --no-interaction || behat --strict -vvv --no-interaction --rerun", + "suite": [ + "@ecs", + "@phpstan", + "@psalm", + "@phpunit", + "@phpspec", + "@behat" ], "auto-scripts": { - "cache:clear": "symfony-cmd", - "assets:install %PUBLIC_DIR%": "symfony-cmd", "security-checker security:check": "script" - } + }, + "post-install-cmd": [ + "@create-console-symlink" + ], + "post-update-cmd": [ + "@create-console-symlink" + ], + "create-console-symlink": [ + "@php bin/create_console_symlink.php" + ] } } diff --git a/src/Resources/config/config.yml b/config/app/config.yaml similarity index 75% rename from src/Resources/config/config.yml rename to config/app/config.yaml index 9720355..fb20a30 100644 --- a/src/Resources/config/config.yml +++ b/config/app/config.yaml @@ -1,6 +1,3 @@ -imports: - - { resource: "@SyliusCustomerReorderPlugin/Resources/config/services.xml" } - sylius_grid: grids: sylius_shop_account_order: @@ -16,4 +13,4 @@ sylius_grid: id: resource.id templates: action: - reorder: "@SyliusCustomerReorderPlugin/reorder.html.twig" + reorder: "@SyliusCustomerReorderPlugin/shop/order/grid/action/reorder.html.twig" diff --git a/src/Resources/config/app/reorder_routing.yml b/config/app_routing.yaml similarity index 100% rename from src/Resources/config/app/reorder_routing.yml rename to config/app_routing.yaml diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..e5c8dc0 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,2 @@ +imports: + - { resource: 'app/config.yaml' } diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..4f92294 --- /dev/null +++ b/config/services.php @@ -0,0 +1,126 @@ +services(); + + $services->defaults() + ->public() + ; + + $services->set(CustomerReorderAction::class) + ->args([ + service('sylius_shop.storage.cart_session'), + service('sylius.context.channel'), + service('sylius.context.customer'), + service('sylius.repository.order'), + service(Reorderer::class), + service('router'), + service('request_stack'), + ]) + ; + + $services->set(Reorderer::class) + ->args([ + service(OrderFactory::class), + service('doctrine.orm.entity_manager'), + service(CompositeReorderEligibilityChecker::class), + service(ReorderEligibilityCheckerResponseProcessor::class), + service(OrderCustomerRelationChecker::class), + ]) + ; + + $services->set(OrderFactory::class) + ->args([ + service('sylius.factory.order'), + service(CompositeReorderProcessor::class), + ]) + ; + + $services->set(CompositeReorderEligibilityChecker::class) + ->public(false) + ; + + $services->set(InsufficientItemQuantityEligibilityChecker::class) + ->args([ + service(ReorderEligibilityConstraintMessageFormatter::class), + ]) + ->tag('sylius_customer_reorder_plugin.eligibility_checker', ['priority' => 40]) + ; + + $services->set(ItemsOutOfStockEligibilityChecker::class) + ->args([ + service(ReorderEligibilityConstraintMessageFormatter::class), + service('sylius.checker.inventory.availability'), + ]) + ->tag('sylius_customer_reorder_plugin.eligibility_checker', ['priority' => 30]) + ; + + $services->set(ReorderItemPricesEligibilityChecker::class) + ->args([ + service(ReorderEligibilityConstraintMessageFormatter::class), + ]) + ->tag('sylius_customer_reorder_plugin.eligibility_checker', ['priority' => 20]) + ; + + $services->set(ReorderPromotionsEligibilityChecker::class) + ->args([ + service(ReorderEligibilityConstraintMessageFormatter::class), + ]) + ->tag('sylius_customer_reorder_plugin.eligibility_checker', ['priority' => 10]) + ; + + $services->set('sylius.reorder.eligibility_checker.total', TotalReorderAmountEligibilityChecker::class) + ->args([ + service('sylius.formatter.money'), + ]) + ->tag('sylius_customer_reorder_plugin.eligibility_checker', ['priority' => 0]) + ; + + $services->set(CompositeReorderProcessor::class) + ->public(false) + ; + + $services->set(ReorderDataProvider::class) + ->tag('sylius_customer_reorder_plugin.reorder_processor', ['priority' => 10]) + ; + + $services->set(ReorderItemsProcessor::class) + ->args([ + service('sylius.modifier.order_item_quantity'), + service('sylius.modifier.order'), + service('sylius.checker.inventory.availability'), + service('sylius.factory.order_item'), + ]) + ->tag('sylius_customer_reorder_plugin.reorder_processor', ['priority' => 0]) + ; + + $services->set(ReorderEligibilityConstraintMessageFormatter::class); + + $services->set(ReorderEligibilityCheckerResponseProcessor::class) + ->args([ + service('request_stack'), + ]) + ; + + $services->set(OrderCustomerRelationChecker::class); +}; diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index a3e00ab..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,42 +0,0 @@ -services: - app: - image: sylius/standard:1.11-traditional-alpine - environment: - APP_ENV: "dev" - DATABASE_URL: "mysql://root:mysql@mysql/sylius_%kernel.environment%?charset=utf8mb4" -# DATABASE_URL: "pgsql://root:postgres@postgres/sylius_%kernel.environment%?charset=utf8" # When using postgres - PHP_DATE_TIMEZONE: "Europe/Warsaw" - volumes: - - ./:/app:delegated - - ./.docker/php/php.ini:/etc/php8/php.ini:delegated - - ./.docker/nginx/nginx.conf:/etc/nginx/nginx.conf:delegated - ports: - - 80:80 - depends_on: - - mysql - networks: - - sylius - - mysql: - image: mysql:8.0 - platform: linux/amd64 - environment: - MYSQL_ROOT_PASSWORD: mysql - ports: - - ${MYSQL_PORT:-3306}:3306 - networks: - - sylius - -# postgres: -# image: postgres:14-alpine -# environment: -# POSTGRES_USER: root -# POSTGRES_PASSWORD: postgres -# ports: -# - ${POSTGRES_PORT:-5432}:5432 -# networks: -# - sylius - -networks: - sylius: - driver: bridge diff --git a/docs/legacy_installation.md b/docs/legacy_installation.md deleted file mode 100644 index 989f333..0000000 --- a/docs/legacy_installation.md +++ /dev/null @@ -1,35 +0,0 @@ -### Legacy installation (without Symfony Flex) - -1. Require plugin with composer: - - ```bash - composer require sylius/customer-reorder-plugin - ``` - -2. Import configuration to `app/config/config.yml`: - - ```yaml - imports: - - { resource: "@SyliusCustomerReorderPlugin/Resources/config/config.yml" } - ``` - -3. Import routing to `app/config/routing.yml`: - - ```yaml - sylius_customer_reorder: - resource: "@SyliusCustomerReorderPlugin/Resources/config/app/reorder_routing.yml" - ``` - -4. Add plugin class to your `AppKernel`: - - ```php - $bundles = [ - new \Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin(), - ]; - ``` - -5. Clear cache: - - ```bash - bin/console cache:clear - ``` diff --git a/easy-coding-standard.yml b/easy-coding-standard.yml deleted file mode 100644 index 2403599..0000000 --- a/easy-coding-standard.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' } diff --git a/ecs.php b/ecs.php index fb0426f..285c8fa 100644 --- a/ecs.php +++ b/ecs.php @@ -9,6 +9,7 @@ $ecsConfig->paths([ __DIR__ . '/src', __DIR__ . '/tests/Behat', + __DIR__ . '/tests/Integration', __DIR__ . '/ecs.php', ]); diff --git a/node_modules b/node_modules index 9270531..f802bac 120000 --- a/node_modules +++ b/node_modules @@ -1 +1 @@ -tests/Application/node_modules \ No newline at end of file +vendor/sylius/test-application/node_modules \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index 8dc24b0..6ffb394 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -10,12 +10,11 @@ parameters: - 'src/DependencyInjection/Configuration.php' # Test dependencies - - 'tests/Application/app/**.php' - - 'tests/Application/src/**.php' + - 'tests/TestApplication/src/**.php' ignoreErrors: - - - identifier: missingType.iterableValue - identifier: missingType.generics + - + identifier: missingType.iterableValue - '/Parameter #1 \$configuration of method Symfony\\Component\\DependencyInjection\\Extension\\Extension::processConfiguration\(\) expects Symfony\\Component\\Config\\Definition\\ConfigurationInterface, Symfony\\Component\\Config\\Definition\\ConfigurationInterface\|null given\./' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 042a638..6352309 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,40 @@ - + bootstrap="vendor/sylius/test-application/config/bootstrap.php" +> + + + + + + + + + - + tests - - - + + tests/Unit + - - + + tests/Functional + - - - + + tests/Integration + + + + tests/Functional + tests/Integration + + diff --git a/psalm.xml b/psalm.xml index 3240886..5611b5f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + phpVersion="8.4" > @@ -12,4 +13,10 @@ + + + var/cache/dev/Sylius_TestApplication_KernelDevDebugContainer.xml + var/cache/test/Sylius_TestApplication_KernelTestDebugContainer.xml + + diff --git a/roave-bc-check.yaml b/roave-bc-check.yaml new file mode 100644 index 0000000..dbd4f3b --- /dev/null +++ b/roave-bc-check.yaml @@ -0,0 +1,3 @@ +parameters: + ignoreErrors: + - '#\[BC\] SKIPPED: Roave\\BetterReflection\\Reflection\\ReflectionClass ".*?" could not be found in the located source#' diff --git a/spec/ReorderEligibility/TotalReorderAmountEligibilityCheckerSpec.php b/spec/ReorderEligibility/TotalReorderAmountEligibilityCheckerSpec.php index 87efd69..23c0943 100644 --- a/spec/ReorderEligibility/TotalReorderAmountEligibilityCheckerSpec.php +++ b/spec/ReorderEligibility/TotalReorderAmountEligibilityCheckerSpec.php @@ -33,8 +33,8 @@ public function it_returns_positive_result_when_total_amounts_are_the_same( OrderInterface $order, OrderInterface $reorder, ): void { - $order->getTotal()->willReturn(100); - $reorder->getTotal()->willReturn(100); + $order->getItemsTotal()->willReturn(100); + $reorder->getItemsTotal()->willReturn(100); $response = $this->check($order, $reorder); $response->shouldBeEqualTo([]); @@ -45,9 +45,9 @@ public function it_returns_violation_message_when_total_amounts_differ( OrderInterface $reorder, MoneyFormatterInterface $moneyFormatter, ): void { - $order->getTotal()->willReturn(100); + $order->getItemsTotal()->willReturn(100); $order->getCurrencyCode()->willReturn('USD'); - $reorder->getTotal()->willReturn(150); + $reorder->getItemsTotal()->willReturn(150); $moneyFormatter->format(100, 'USD')->willReturn('$100.00'); diff --git a/src/Checker/OrderCustomerRelationChecker.php b/src/Checker/OrderCustomerRelationChecker.php index f8f9048..370fd8a 100644 --- a/src/Checker/OrderCustomerRelationChecker.php +++ b/src/Checker/OrderCustomerRelationChecker.php @@ -9,6 +9,7 @@ final class OrderCustomerRelationChecker implements OrderCustomerRelationCheckerInterface { + #[\Override] public function wasOrderPlacedByCustomer(OrderInterface $order, CustomerInterface $customer): bool { /** @var CustomerInterface|null $orderCustomer */ diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 3ab0062..6108877 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -7,9 +7,13 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +/** + * @psalm-api + */ final class Configuration implements ConfigurationInterface { /** @psalm-suppress UnusedVariable */ + #[\Override] public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('sylius_customer_reorder_plugin'); diff --git a/src/DependencyInjection/SyliusCustomerReorderExtension.php b/src/DependencyInjection/SyliusCustomerReorderExtension.php new file mode 100644 index 0000000..acc4925 --- /dev/null +++ b/src/DependencyInjection/SyliusCustomerReorderExtension.php @@ -0,0 +1,49 @@ +load('services.php'); + } + + #[\Override] + public function prepend(ContainerBuilder $container): void + { + $this->prependDoctrineMigrations($container); + } + + #[\Override] + protected function getMigrationsNamespace(): string + { + return 'Sylius\CustomerReorderPlugin\Migrations'; + } + + #[\Override] + protected function getMigrationsDirectory(): string + { + return '@SyliusCustomerReorderPlugin/src/Migrations'; + } + + #[\Override] + protected function getNamespacesOfMigrationsExecutedBefore(): array + { + return ['Sylius\Bundle\CoreBundle\Migrations']; + } +} diff --git a/src/Factory/OrderFactory.php b/src/Factory/OrderFactory.php index cfbbe81..9760cf1 100644 --- a/src/Factory/OrderFactory.php +++ b/src/Factory/OrderFactory.php @@ -21,6 +21,7 @@ public function __construct(private FactoryInterface $baseOrderFactory, private { } + #[\Override] public function createFromExistingOrder(OrderInterface $order, ChannelInterface $channel): OrderInterface { $reorder = $this->baseOrderFactory->createNew(); diff --git a/tests/Application/config/secrets/prod/.gitignore b/src/Migrations/.gitkeep similarity index 100% rename from tests/Application/config/secrets/prod/.gitignore rename to src/Migrations/.gitkeep diff --git a/src/Reorder/Reorderer.php b/src/Reorder/Reorderer.php index dbfb510..3b3aa24 100644 --- a/src/Reorder/Reorderer.php +++ b/src/Reorder/Reorderer.php @@ -25,6 +25,7 @@ public function __construct( ) { } + #[\Override] public function reorder( OrderInterface $order, ChannelInterface $channel, diff --git a/src/ReorderEligibility/CompositeReorderEligibilityChecker.php b/src/ReorderEligibility/CompositeReorderEligibilityChecker.php index c8e7028..9ed3bc7 100644 --- a/src/ReorderEligibility/CompositeReorderEligibilityChecker.php +++ b/src/ReorderEligibility/CompositeReorderEligibilityChecker.php @@ -25,6 +25,7 @@ public function addChecker(ReorderEligibilityChecker $eligibilityChecker, int $p $this->eligibilityCheckers->insert($eligibilityChecker, $priority); } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { $eligibilityCheckersFailures = []; diff --git a/src/ReorderEligibility/InsufficientItemQuantityEligibilityChecker.php b/src/ReorderEligibility/InsufficientItemQuantityEligibilityChecker.php index be38152..9c99075 100644 --- a/src/ReorderEligibility/InsufficientItemQuantityEligibilityChecker.php +++ b/src/ReorderEligibility/InsufficientItemQuantityEligibilityChecker.php @@ -15,6 +15,7 @@ public function __construct( ) { } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { $orderProductNamesToQuantity = []; diff --git a/src/ReorderEligibility/ItemsOutOfStockEligibilityChecker.php b/src/ReorderEligibility/ItemsOutOfStockEligibilityChecker.php index 0752fae..63599cf 100644 --- a/src/ReorderEligibility/ItemsOutOfStockEligibilityChecker.php +++ b/src/ReorderEligibility/ItemsOutOfStockEligibilityChecker.php @@ -17,6 +17,7 @@ public function __construct( ) { } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { /** @var string[] $productsOutOfStock */ diff --git a/src/ReorderEligibility/ReorderEligibilityCheckerResponse.php b/src/ReorderEligibility/ReorderEligibilityCheckerResponse.php index 51590e9..1d95f7b 100644 --- a/src/ReorderEligibility/ReorderEligibilityCheckerResponse.php +++ b/src/ReorderEligibility/ReorderEligibilityCheckerResponse.php @@ -4,6 +4,9 @@ namespace Sylius\CustomerReorderPlugin\ReorderEligibility; +/** + * @psalm-api + */ class ReorderEligibilityCheckerResponse { /** @param array $parameters */ diff --git a/src/ReorderEligibility/ReorderEligibilityConstraintMessageFormatter.php b/src/ReorderEligibility/ReorderEligibilityConstraintMessageFormatter.php index cdbf3c2..7c407ea 100644 --- a/src/ReorderEligibility/ReorderEligibilityConstraintMessageFormatter.php +++ b/src/ReorderEligibility/ReorderEligibilityConstraintMessageFormatter.php @@ -6,6 +6,7 @@ final class ReorderEligibilityConstraintMessageFormatter implements ReorderEligibilityConstraintMessageFormatterInterface { + #[\Override] public function format(array $messageParameters): string { $message = ''; diff --git a/src/ReorderEligibility/ReorderItemPricesEligibilityChecker.php b/src/ReorderEligibility/ReorderItemPricesEligibilityChecker.php index aea1e59..b9cb664 100644 --- a/src/ReorderEligibility/ReorderItemPricesEligibilityChecker.php +++ b/src/ReorderEligibility/ReorderItemPricesEligibilityChecker.php @@ -15,6 +15,7 @@ public function __construct( ) { } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { $orderProductNamesToTotal = []; diff --git a/src/ReorderEligibility/ReorderPromotionsEligibilityChecker.php b/src/ReorderEligibility/ReorderPromotionsEligibilityChecker.php index 9438dcf..c50bfa6 100644 --- a/src/ReorderEligibility/ReorderPromotionsEligibilityChecker.php +++ b/src/ReorderEligibility/ReorderPromotionsEligibilityChecker.php @@ -15,6 +15,7 @@ public function __construct( ) { } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { if (0 === count($reorder->getItems()->getValues()) || diff --git a/src/ReorderEligibility/ResponseProcessing/EligibilityCheckerFailureResponses.php b/src/ReorderEligibility/ResponseProcessing/EligibilityCheckerFailureResponses.php index 8d14917..7473d48 100644 --- a/src/ReorderEligibility/ResponseProcessing/EligibilityCheckerFailureResponses.php +++ b/src/ReorderEligibility/ResponseProcessing/EligibilityCheckerFailureResponses.php @@ -6,17 +6,13 @@ final class EligibilityCheckerFailureResponses { - public const INSUFFICIENT_ITEM_QUANTITY = 'sylius.reorder.insufficient_quantity'; + public const string INSUFFICIENT_ITEM_QUANTITY = 'sylius.reorder.insufficient_quantity'; - public const ITEMS_OUT_OF_STOCK = 'sylius.reorder.items_out_of_stock'; + public const string ITEMS_OUT_OF_STOCK = 'sylius.reorder.items_out_of_stock'; - public const REORDER_ITEMS_PRICES_CHANGED = 'sylius.reorder.items_price_changed'; + public const string REORDER_ITEMS_PRICES_CHANGED = 'sylius.reorder.items_price_changed'; - public const REORDER_PROMOTIONS_CHANGED = 'sylius.reorder.promotion_not_enabled'; + public const string REORDER_PROMOTIONS_CHANGED = 'sylius.reorder.promotion_not_enabled'; - public const TOTAL_AMOUNT_CHANGED = 'sylius.reorder.previous_order_total'; - - private function __construct() - { - } + public const string TOTAL_AMOUNT_CHANGED = 'sylius.reorder.previous_order_total'; } diff --git a/src/ReorderEligibility/ResponseProcessing/ReorderEligibilityCheckerResponseProcessor.php b/src/ReorderEligibility/ResponseProcessing/ReorderEligibilityCheckerResponseProcessor.php index bd65881..36b4af6 100644 --- a/src/ReorderEligibility/ResponseProcessing/ReorderEligibilityCheckerResponseProcessor.php +++ b/src/ReorderEligibility/ResponseProcessing/ReorderEligibilityCheckerResponseProcessor.php @@ -14,6 +14,7 @@ public function __construct(private RequestStack $requestStack) { } + #[\Override] public function process(array $responses): void { /** @var ReorderEligibilityCheckerResponse $response */ diff --git a/src/ReorderEligibility/TotalReorderAmountEligibilityChecker.php b/src/ReorderEligibility/TotalReorderAmountEligibilityChecker.php index 42b53ed..071d198 100644 --- a/src/ReorderEligibility/TotalReorderAmountEligibilityChecker.php +++ b/src/ReorderEligibility/TotalReorderAmountEligibilityChecker.php @@ -14,15 +14,16 @@ public function __construct(private MoneyFormatterInterface $moneyFormatter) { } + #[\Override] public function check(OrderInterface $order, OrderInterface $reorder): array { - if ($order->getTotal() === $reorder->getTotal()) { + if ($order->getItemsTotal() === $reorder->getItemsTotal()) { return []; } /** @var string $currencyCode */ $currencyCode = $order->getCurrencyCode(); - $formattedTotal = $this->moneyFormatter->format($order->getTotal(), $currencyCode); + $formattedTotal = $this->moneyFormatter->format($order->getItemsTotal(), $currencyCode); $eligibilityCheckerResponse = new ReorderEligibilityCheckerResponse( EligibilityCheckerFailureResponses::TOTAL_AMOUNT_CHANGED, diff --git a/src/ReorderProcessing/CompositeReorderProcessor.php b/src/ReorderProcessing/CompositeReorderProcessor.php index ff89b5f..611663a 100644 --- a/src/ReorderProcessing/CompositeReorderProcessor.php +++ b/src/ReorderProcessing/CompositeReorderProcessor.php @@ -25,6 +25,7 @@ public function addProcessor(ReorderProcessor $orderProcessor, int $priority = 0 $this->reorderProcessors->insert($orderProcessor, $priority); } + #[\Override] public function process(OrderInterface $order, OrderInterface $reorder): void { /** @var mixed|ReorderProcessor $reorderProcessor */ diff --git a/src/ReorderProcessing/ReorderDataProvider.php b/src/ReorderProcessing/ReorderDataProvider.php index 9b35933..7bf2e9a 100644 --- a/src/ReorderProcessing/ReorderDataProvider.php +++ b/src/ReorderProcessing/ReorderDataProvider.php @@ -8,6 +8,7 @@ final class ReorderDataProvider implements ReorderProcessor { + #[\Override] public function process(OrderInterface $order, OrderInterface $reorder): void { $reorder->setCustomer($order->getCustomer()); diff --git a/src/ReorderProcessing/ReorderItemsProcessor.php b/src/ReorderProcessing/ReorderItemsProcessor.php index 9a588b4..968f55a 100644 --- a/src/ReorderProcessing/ReorderItemsProcessor.php +++ b/src/ReorderProcessing/ReorderItemsProcessor.php @@ -28,6 +28,7 @@ public function __construct( ) { } + #[\Override] public function process(OrderInterface $order, OrderInterface $reorder): void { $orderItems = $order->getItems(); diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml deleted file mode 100644 index 1eaae60..0000000 --- a/src/Resources/config/services.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/views/reorder.html.twig b/src/Resources/views/reorder.html.twig deleted file mode 100644 index 757fb90..0000000 --- a/src/Resources/views/reorder.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('reorder')), options.link.parameters|default({'id': data.id}))) %} - -
- -
diff --git a/src/SyliusCustomerReorderPlugin.php b/src/SyliusCustomerReorderPlugin.php index c43dbb8..cb264cd 100644 --- a/src/SyliusCustomerReorderPlugin.php +++ b/src/SyliusCustomerReorderPlugin.php @@ -10,18 +10,23 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; +/** + * @psalm-api + */ final class SyliusCustomerReorderPlugin extends Bundle { use SyliusPluginTrait; + #[\Override] public function build(ContainerBuilder $container): void { $container->addCompilerPass(new RegisterEligibilityCheckersPass()); $container->addCompilerPass(new RegisterReorderProcessorsPass()); } + #[\Override] public function getPath(): string { - return __DIR__; + return \dirname(__DIR__); } } diff --git a/symfony.lock b/symfony.lock deleted file mode 100644 index ecbc144..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": "9.6", - "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/templates/shop/order/grid/action/reorder.html.twig b/templates/shop/order/grid/action/reorder.html.twig new file mode 100644 index 0000000..920133f --- /dev/null +++ b/templates/shop/order/grid/action/reorder.html.twig @@ -0,0 +1,13 @@ +{% import '@SyliusShop/shared/buttons.html.twig' as buttons %} + +{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('reorder')), options.link.parameters|default({'id': data.id}))) %} +{% set icon = action.options.icon is defined ? action.options.icon : null %} + +
+ +
diff --git a/tests/Application/.env b/tests/Application/.env deleted file mode 100644 index 0f94464..0000000 --- a/tests/Application/.env +++ /dev/null @@ -1,33 +0,0 @@ -# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file -# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production. -# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration - -###> symfony/framework-bundle ### -APP_ENV=dev -APP_DEBUG=1 -APP_SECRET=EDITME -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db" -# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls -DATABASE_URL=mysql://root@127.0.0.1/sylius_customer_reorder_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/mailer ### -MAILER_DSN=null://null -###< symfony/mailer ### - -###> symfony/messenger ### -# Choose one of the transports below -# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages -MESSENGER_TRANSPORT_DSN=doctrine://default -# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages -###< symfony/messenger ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test deleted file mode 100644 index 08f3df5..0000000 --- a/tests/Application/.env.test +++ /dev/null @@ -1,3 +0,0 @@ -APP_SECRET='ch4mb3r0f5ecr3ts' - -KERNEL_CLASS='Tests\Sylius\CustomerReorderPlugin\Application\Kernel' diff --git a/tests/Application/.eslintrc.js b/tests/Application/.eslintrc.js deleted file mode 100644 index 92c4cee..0000000 --- a/tests/Application/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - extends: 'airbnb-base', - env: { - node: true, - }, - rules: { - 'object-shorthand': ['error', 'always', { - avoidQuotes: true, - avoidExplicitReturnArrows: true, - }], - 'function-paren-newline': ['error', 'consistent'], - 'max-len': ['warn', 120, 2, { - ignoreUrls: true, - ignoreComments: false, - ignoreRegExpLiterals: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - }], - }, -}; diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore deleted file mode 100644 index bc600a8..0000000 --- a/tests/Application/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -/public/assets -/public/build -/public/css -/public/js -/public/media/* -!/public/media/image/ -/public/media/image/* -!/public/media/image/.gitignore - -/node_modules - -###> symfony/framework-bundle ### -/.env.*.local -/.env.local -/.env.local.php -/public/bundles -/var/ -/vendor/ -###< symfony/framework-bundle ### - -###> symfony/web-server-bundle ### -/.web-server-pid -###< symfony/web-server-bundle ### diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php deleted file mode 100644 index 2660f3c..0000000 --- a/tests/Application/Kernel.php +++ /dev/null @@ -1,97 +0,0 @@ -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/entry.js b/tests/Application/assets/admin/entry.js deleted file mode 100644 index 635f5ac..0000000 --- a/tests/Application/assets/admin/entry.js +++ /dev/null @@ -1 +0,0 @@ -import 'sylius/bundle/AdminBundle/Resources/private/entry'; diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js deleted file mode 100644 index aadc317..0000000 --- a/tests/Application/assets/shop/entry.js +++ /dev/null @@ -1 +0,0 @@ -import 'sylius/bundle/ShopBundle/Resources/private/entry'; diff --git a/tests/Application/bin/console b/tests/Application/bin/console deleted file mode 100755 index a130114..0000000 --- a/tests/Application/bin/console +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env php -getParameterOption(['--env', '-e'], null, true)) { - putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); -} - -if ($input->hasParameterOption('--no-debug', true)) { - putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); -} - -require dirname(__DIR__).'/config/bootstrap.php'; - -if ($_SERVER['APP_DEBUG']) { - umask(0000); - - if (class_exists(Debug::class)) { - Debug::enable(); - } -} - -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); -$application = new Application($kernel); -$application->run($input); diff --git a/tests/Application/composer.json b/tests/Application/composer.json deleted file mode 100644 index e71d32b..0000000 --- a/tests/Application/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "sylius/customer-reorder-plugin-test-application", - "description": "Sylius application for plugin testing purposes (composer.json needed for project dir resolving)", - "license": "MIT" -} diff --git a/tests/Application/config/bootstrap.php b/tests/Application/config/bootstrap.php deleted file mode 100644 index c9951a7..0000000 --- a/tests/Application/config/bootstrap.php +++ /dev/null @@ -1,27 +0,0 @@ -=1.2) -if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { - $_SERVER += $env; - $_ENV += $env; -} elseif (!class_exists(Dotenv::class)) { - throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); -} elseif (method_exists(Dotenv::class, 'bootEnv')) { - (new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); - - return; -} else { - // load all the .env files - (new Dotenv(true))->loadEnv(dirname(__DIR__) . '/.env'); -} - -$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; -$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; -$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php deleted file mode 100644 index 5266bed..0000000 --- a/tests/Application/config/bundles.php +++ /dev/null @@ -1,66 +0,0 @@ - ['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\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true], - Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true], - Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true], - Sylius\Bundle\LocaleBundle\SyliusLocaleBundle::class => ['all' => true], - Sylius\Bundle\ProductBundle\SyliusProductBundle::class => ['all' => true], - Sylius\Bundle\ChannelBundle\SyliusChannelBundle::class => ['all' => true], - Sylius\Bundle\AttributeBundle\SyliusAttributeBundle::class => ['all' => true], - Sylius\Bundle\TaxationBundle\SyliusTaxationBundle::class => ['all' => true], - Sylius\Bundle\ShippingBundle\SyliusShippingBundle::class => ['all' => true], - Sylius\Bundle\PaymentBundle\SyliusPaymentBundle::class => ['all' => true], - Sylius\Bundle\MailerBundle\SyliusMailerBundle::class => ['all' => true], - Sylius\Bundle\PromotionBundle\SyliusPromotionBundle::class => ['all' => true], - Sylius\Bundle\AddressingBundle\SyliusAddressingBundle::class => ['all' => true], - Sylius\Bundle\InventoryBundle\SyliusInventoryBundle::class => ['all' => true], - Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle::class => ['all' => true], - Sylius\Bundle\UserBundle\SyliusUserBundle::class => ['all' => true], - Sylius\Bundle\CustomerBundle\SyliusCustomerBundle::class => ['all' => true], - Sylius\Bundle\UiBundle\SyliusUiBundle::class => ['all' => true], - Sylius\Bundle\ReviewBundle\SyliusReviewBundle::class => ['all' => true], - Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], - Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], - Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], - winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], - Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], - Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], - JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], - Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], - Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], - Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], - Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true], - Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], - 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], - Sylius\CustomerReorderPlugin\SyliusCustomerReorderPlugin::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], - Sylius\Bundle\ApiBundle\SyliusApiBundle::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], -]; -if (class_exists(Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class)) { - $bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::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----- -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+JE0XWzPvukNUyggtekTLyoQCI3ZKge6ui3qLax -N6whHpzFnFVF3GJAisTk5naHFawHNvH7t85pmc+UnjNUUmyl9RStl9LMYDSBKNlR -LzPlJK27E5SLhhyJCni4+UYjH6PdlJuKXJ0365fufJ+5ajHRatwt039xLnK0W+oa -L35NxCuXrn8YxOgJIomt7IrkV3AuxoWxcx4lRFoM0WCdn9SWZVtfFFiyX/Xr1qDg -dUysw3/bePEkOKr5JWx09hT0OKDpkwLFo2Ljtvjln4EMXYEvvVqFciKw0kqF73Dw -NyoSubwR4qs6FQclKW1TAP6UW4B6ffq1iagKOCTZ5bBtsPBZk8UGCJb57q4fUj4P -nJy0hnSdlOH4Am+US4HF4ayOGuaV1Be1taurdJnt5cNnUYRah0wg4nG+wVdG5HJk -f4dJ4nih9d6WA/8LfxdpB7NCwdR+KK6lky+GgLSdhmIT9lzjj2GDsU4lBf29TkBn -lyt98/LWGrgCQgZAQ/obxLT8CZtY+tNejGoMppY+ub8DIaLBFID+fcz13kgA9x7a -TeVB8RPok+S3yHXP9a4WSFe9DGjjN+m7EnRtte7MEjyMoekXVnT04gNbTMoGAjNb -lrR4g3ICygZtsoGSB2VEu7o3azAspXNBMOuJfRCuC0LDXcjH3TbvjX0da5wHBoK9 -clRxu+CDo9A849HMkmSje8wED7ysZnkvSX0OdPjXahVd4t1tDRI6jSlzFo9fGcjp -S8Ikm9iMrHXaWcDdtcq4C63CjSynIBr4mNIxe/f2e9nynm3AIv+aOan891RWHqrd -DdpSSPShtzATI9PbB+b+S0Gw58Y8fpO7yoZ87VW1BMpadmFZ87YY78jdB7BwInNI -JqtnivinM6qCsvbdMoGinUyL6PUcfQGiEAibouKr3zNRDC4aesBZZmj7w0dnf+HK -YC905aR0cddlc6DBo/ed3o9krMcZ6oY/vruemPTc5G7Cg3t4H3mInRgURw22X1wo -FsioU1yOdkK+MYxvmGsQvQuSJhp7h1Uz37t/olkPRafZgy2nEtw6DQO0Dm4UfSsD -nysq6dn1WeZPkOipGBRgQmY1FTRzwPoCxi7+/EuHhD8hr962rHOglSuNqPG89J8r -wdbTDr8kgXj2A9p+jI3TVKEX+h6FEhrCHW9SHUqATOZ7RiNL6hKld9j0U4D9gQwZ -dflA0TxpVsHXm7pd1idkr46jIFgw7HA89Erm0Ty7RolfHkqlRca805AVmsKkviIz -sbF5uv4WzIE3ViO8P1KMUhCyElm72mpyNTXBhkxkup9hJ4fQieaN6pET6dQ2xyjs -SBIvQoXI0JQKpespcyAdoh88ULQjRUXEOaNFfN7q+itTcocwmPZfzW2nXORJT2p8 -SXLqSE73nYZdqzSYFq1hLcnlubJ7yPBYYG1fI0IydjSGKfnjtB0DReR32OToRZ7m -laduZ8O+IaBUY4Sp6QdYcVbGGpG/wsPmTQyScc/O2bfSI7AiPnL9EnwebI9sPSWQ -R0t0QMXZOSSqNY6jkYjsOCxeekRIdY6havo2Y52Ywti0QNrkT4BQ+175VVTmRMdy -LNaMFeEq6ehSEdaHaozvjHvP50HQT43tCK+RJiL+Gf9FqawoQRt693yO5LFbQsuw -QsUSMi41txpINMa+HEc2K5FvGoPr7FmajLK7X2fr+3c/yZ4fahoMKEAVFWl5kRYx -Fe1smlw1Vxl/qNQ32LFWsBIK+XnYBteYmlpVyYrTgXyjnp1rK2zz0118DPFuYiAP -O0r6nnBz0NbwnSKb7S4CjxBKDvDbWTzP35Q5L/vySnO2zRbM64Gw7sjeLiJittWS -gQfbFpEk9k8KVndKM4H50Jp0WznmYpm1Tman8hUOiCvmq0qdI3bJ5Bnj0K+q2zFV -+noGpMFdq1+8WaUFLQFGCPM+yJgCqDgT1RAgfsGcomckGcmenDtHaTbcSFabEdpM -Tsa2qLdg/Kju+7JyGrkmobXl/azuyjYTHfRvSZrvO5WUDFzhChrJpIL4nA3ZGRlS -gvy+OzyyBh4sRyHwLItwUwE81aya3W4llAkhQ7OycmqniJgjtJzLwnxv2RQsB8bF -pyoqQdKVxkqHdbUFeh9igI4ffRAK+8xDER5J+RUoZ4mO8qJebxar54XTb6I/Lepc -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 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 deleted file mode 100644 index 283f5ef..0000000 --- a/tests/Application/config/packages/_sylius.yaml +++ /dev/null @@ -1,37 +0,0 @@ -imports: - - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } - - - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - - - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - - - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } - - - { resource: "@SyliusCustomerReorderPlugin/Resources/config/services.xml" } - -parameters: - sylius_core.public_dir: '%kernel.project_dir%/public' - -sylius_shop: - product_grid: - include_all_descendants: true - -sylius_api: - enabled: true - -sylius_grid: - grids: - sylius_shop_account_order: - actions: - item: - reorder: - type: reorder - label: sylius_customer_reorder_plugin.ui.reorder - options: - link: - route: sylius_reorder_plugin_reorder - parameters: - id: resource.id - templates: - action: - reorder: "@SyliusCustomerReorderPlugin/reorder.html.twig" diff --git a/tests/Application/config/packages/api_platform.yaml b/tests/Application/config/packages/api_platform.yaml deleted file mode 100644 index b428304..0000000 --- a/tests/Application/config/packages/api_platform.yaml +++ /dev/null @@ -1,10 +0,0 @@ -api_platform: - mapping: - paths: - - '%kernel.project_dir%/../../vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/api_resources' - - '%kernel.project_dir%/config/api_platform' - - '%kernel.project_dir%/src/Entity' - patch_formats: - json: ['application/merge-patch+json'] - swagger: - versions: [3] diff --git a/tests/Application/config/packages/assets.yaml b/tests/Application/config/packages/assets.yaml deleted file mode 100644 index 2468901..0000000 --- a/tests/Application/config/packages/assets.yaml +++ /dev/null @@ -1,7 +0,0 @@ -framework: - assets: - packages: - shop: - json_manifest_path: '%kernel.project_dir%/public/build/shop/manifest.json' - admin: - json_manifest_path: '%kernel.project_dir%/public/build/admin/manifest.json' diff --git a/tests/Application/config/packages/dev/framework.yaml b/tests/Application/config/packages/dev/framework.yaml deleted file mode 100644 index 4b116de..0000000 --- a/tests/Application/config/packages/dev/framework.yaml +++ /dev/null @@ -1,2 +0,0 @@ -framework: - profiler: { only_exceptions: false } diff --git a/tests/Application/config/packages/dev/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/dev/monolog.yaml b/tests/Application/config/packages/dev/monolog.yaml deleted file mode 100644 index da2b092..0000000 --- a/tests/Application/config/packages/dev/monolog.yaml +++ /dev/null @@ -1,9 +0,0 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - firephp: - type: firephp - level: info diff --git a/tests/Application/config/packages/dev/routing.yaml b/tests/Application/config/packages/dev/routing.yaml deleted file mode 100644 index 4116679..0000000 --- a/tests/Application/config/packages/dev/routing.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - router: - strict_requirements: true diff --git a/tests/Application/config/packages/dev/web_profiler.yaml b/tests/Application/config/packages/dev/web_profiler.yaml deleted file mode 100644 index 1f1cb2b..0000000 --- a/tests/Application/config/packages/dev/web_profiler.yaml +++ /dev/null @@ -1,3 +0,0 @@ -web_profiler: - toolbar: true - intercept_redirects: false diff --git a/tests/Application/config/packages/doctrine.yaml b/tests/Application/config/packages/doctrine.yaml deleted file mode 100644 index f51ba5a..0000000 --- a/tests/Application/config/packages/doctrine.yaml +++ /dev/null @@ -1,14 +0,0 @@ -parameters: - # Adds a fallback DATABASE_URL if the env var is not set. - # This allows you to run cache:warmup even if your - # environment variables are not available yet. - # You should not need to change this value. - env(DATABASE_URL): '' - -doctrine: - dbal: - driver: 'pdo_mysql' - server_version: '5.7' - charset: UTF8 - - url: '%env(resolve:DATABASE_URL)%' diff --git a/tests/Application/config/packages/doctrine_migrations.yaml b/tests/Application/config/packages/doctrine_migrations.yaml deleted file mode 100644 index cdbc01a..0000000 --- a/tests/Application/config/packages/doctrine_migrations.yaml +++ /dev/null @@ -1,4 +0,0 @@ -doctrine_migrations: - storage: - table_storage: - table_name: sylius_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 deleted file mode 100644 index 8be076b..0000000 --- a/tests/Application/config/packages/framework.yaml +++ /dev/null @@ -1,9 +0,0 @@ -framework: - secret: '%env(APP_SECRET)%' - form: true - csrf_protection: true - session: - handler_id: ~ - serializer: - mapping: - paths: [ '%kernel.project_dir%/config/serialization' ] 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/lexik_jwt_authentication.yaml b/tests/Application/config/packages/lexik_jwt_authentication.yaml deleted file mode 100644 index edfb69d..0000000 --- a/tests/Application/config/packages/lexik_jwt_authentication.yaml +++ /dev/null @@ -1,4 +0,0 @@ -lexik_jwt_authentication: - secret_key: '%env(resolve:JWT_SECRET_KEY)%' - public_key: '%env(resolve:JWT_PUBLIC_KEY)%' - pass_phrase: '%env(JWT_PASSPHRASE)%' diff --git a/tests/Application/config/packages/liip_imagine.yaml b/tests/Application/config/packages/liip_imagine.yaml deleted file mode 100644 index bb2e7ce..0000000 --- a/tests/Application/config/packages/liip_imagine.yaml +++ /dev/null @@ -1,6 +0,0 @@ -liip_imagine: - resolvers: - default: - web_path: - web_root: "%kernel.project_dir%/public" - cache_prefix: "media/cache" diff --git a/tests/Application/config/packages/mailer.yaml b/tests/Application/config/packages/mailer.yaml deleted file mode 100644 index 56a650d..0000000 --- a/tests/Application/config/packages/mailer.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - mailer: - dsn: '%env(MAILER_DSN)%' diff --git a/tests/Application/config/packages/prod/doctrine.yaml b/tests/Application/config/packages/prod/doctrine.yaml deleted file mode 100644 index 2f16f0f..0000000 --- a/tests/Application/config/packages/prod/doctrine.yaml +++ /dev/null @@ -1,31 +0,0 @@ -doctrine: - orm: - metadata_cache_driver: - type: service - id: doctrine.system_cache_provider - query_cache_driver: - type: service - id: doctrine.system_cache_provider - result_cache_driver: - type: service - id: doctrine.result_cache_provider - -services: - doctrine.result_cache_provider: - class: Symfony\Component\Cache\DoctrineProvider - public: false - arguments: - - '@doctrine.result_cache_pool' - doctrine.system_cache_provider: - class: Symfony\Component\Cache\DoctrineProvider - public: false - arguments: - - '@doctrine.system_cache_pool' - -framework: - cache: - pools: - doctrine.result_cache_pool: - adapter: cache.app - doctrine.system_cache_pool: - adapter: cache.system diff --git a/tests/Application/config/packages/prod/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/prod/monolog.yaml b/tests/Application/config/packages/prod/monolog.yaml deleted file mode 100644 index 6461211..0000000 --- a/tests/Application/config/packages/prod/monolog.yaml +++ /dev/null @@ -1,10 +0,0 @@ -monolog: - handlers: - main: - type: fingers_crossed - action_level: error - handler: nested - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug diff --git a/tests/Application/config/packages/routing.yaml b/tests/Application/config/packages/routing.yaml deleted file mode 100644 index 368bc7f..0000000 --- a/tests/Application/config/packages/routing.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - router: - strict_requirements: ~ diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml deleted file mode 100644 index 4ed342f..0000000 --- a/tests/Application/config/packages/security.yaml +++ /dev/null @@ -1,124 +0,0 @@ -security: - enable_authenticator_manager: true - providers: - sylius_admin_user_provider: - id: sylius.admin_user_provider.email_or_name_based - sylius_api_admin_user_provider: - id: sylius.admin_user_provider.email_or_name_based - sylius_shop_user_provider: - id: sylius.shop_user_provider.email_or_name_based - sylius_api_shop_user_provider: - id: sylius.shop_user_provider.email_or_name_based - - password_hashers: - Sylius\Component\User\Model\UserInterface: argon2i - firewalls: - admin: - switch_user: true - context: admin - pattern: "%sylius.security.admin_regex%" - provider: sylius_admin_user_provider - form_login: - provider: sylius_admin_user_provider - login_path: sylius_admin_login - check_path: sylius_admin_login_check - failure_path: sylius_admin_login - default_target_path: sylius_admin_dashboard - use_forward: false - use_referer: true - enable_csrf: true - csrf_parameter: _csrf_admin_security_token - csrf_token_id: admin_authenticate - remember_me: - secret: "%env(APP_SECRET)%" - path: "/%sylius_admin.path_name%" - name: APP_ADMIN_REMEMBER_ME - lifetime: 31536000 - remember_me_parameter: _remember_me - logout: - path: sylius_admin_logout - target: sylius_admin_login - - new_api_admin_user: - pattern: "%sylius.security.new_api_admin_regex%/.*" - provider: sylius_api_admin_user_provider - stateless: true - entry_point: jwt - json_login: - check_path: "%sylius.security.new_api_admin_route%/authentication-token" - username_path: email - password_path: password - success_handler: lexik_jwt_authentication.handler.authentication_success - failure_handler: lexik_jwt_authentication.handler.authentication_failure - jwt: true - - new_api_shop_user: - pattern: "%sylius.security.new_api_shop_regex%/.*" - provider: sylius_api_shop_user_provider - stateless: true - entry_point: jwt - json_login: - check_path: "%sylius.security.new_api_shop_route%/authentication-token" - username_path: email - password_path: password - success_handler: lexik_jwt_authentication.handler.authentication_success - failure_handler: lexik_jwt_authentication.handler.authentication_failure - jwt: true - - shop: - switch_user: { role: ROLE_ALLOWED_TO_SWITCH } - context: shop - pattern: "%sylius.security.shop_regex%" - provider: sylius_shop_user_provider - form_login: - success_handler: sylius.authentication.success_handler - failure_handler: sylius.authentication.failure_handler - provider: sylius_shop_user_provider - login_path: sylius_shop_login - check_path: sylius_shop_login_check - failure_path: sylius_shop_login - default_target_path: sylius_shop_homepage - use_forward: false - use_referer: true - enable_csrf: true - csrf_parameter: _csrf_shop_security_token - csrf_token_id: shop_authenticate - remember_me: - secret: "%env(APP_SECRET)%" - name: APP_SHOP_REMEMBER_ME - lifetime: 31536000 - remember_me_parameter: _remember_me - logout: - path: sylius_shop_logout - target: sylius_shop_homepage - invalidate_session: false - - dev: - pattern: ^/(_(profiler|wdt)|css|images|js)/ - security: false - - image_resolver: - pattern: ^/media/cache/resolve - 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%/login", role: PUBLIC_ACCESS } - - { path: "%sylius.security.shop_regex%/login", role: PUBLIC_ACCESS } - - - { path: "%sylius.security.shop_regex%/register", role: PUBLIC_ACCESS } - - { path: "%sylius.security.shop_regex%/verify", role: PUBLIC_ACCESS } - - - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } - - - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } - - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } - - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } - - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Application/config/packages/staging/monolog.yaml b/tests/Application/config/packages/staging/monolog.yaml deleted file mode 100644 index 6461211..0000000 --- a/tests/Application/config/packages/staging/monolog.yaml +++ /dev/null @@ -1,10 +0,0 @@ -monolog: - handlers: - main: - type: fingers_crossed - action_level: error - handler: nested - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug diff --git a/tests/Application/config/packages/stof_doctrine_extensions.yaml b/tests/Application/config/packages/stof_doctrine_extensions.yaml deleted file mode 100644 index 7770f74..0000000 --- a/tests/Application/config/packages/stof_doctrine_extensions.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html -# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/ -stof_doctrine_extensions: - default_locale: '%locale%' diff --git a/tests/Application/config/packages/test/framework.yaml b/tests/Application/config/packages/test/framework.yaml deleted file mode 100644 index fc1d3c1..0000000 --- a/tests/Application/config/packages/test/framework.yaml +++ /dev/null @@ -1,4 +0,0 @@ -framework: - test: ~ - session: - storage_factory_id: session.storage.factory.mock_file diff --git a/tests/Application/config/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/monolog.yaml b/tests/Application/config/packages/test/monolog.yaml deleted file mode 100644 index 7e2b9e3..0000000 --- a/tests/Application/config/packages/test/monolog.yaml +++ /dev/null @@ -1,6 +0,0 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: error diff --git a/tests/Application/config/packages/test/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_theme.yaml b/tests/Application/config/packages/test/sylius_theme.yaml deleted file mode 100644 index 4d34199..0000000 --- a/tests/Application/config/packages/test/sylius_theme.yaml +++ /dev/null @@ -1,3 +0,0 @@ -sylius_theme: - sources: - test: ~ diff --git a/tests/Application/config/packages/test/sylius_uploader.yaml b/tests/Application/config/packages/test/sylius_uploader.yaml deleted file mode 100644 index ab9d6ca..0000000 --- a/tests/Application/config/packages/test/sylius_uploader.yaml +++ /dev/null @@ -1,3 +0,0 @@ -services: - Sylius\Component\Core\Generator\ImagePathGeneratorInterface: - class: Sylius\Behat\Service\Generator\UploadedImagePathGenerator diff --git a/tests/Application/config/packages/test/web_profiler.yaml b/tests/Application/config/packages/test/web_profiler.yaml deleted file mode 100644 index 03752de..0000000 --- a/tests/Application/config/packages/test/web_profiler.yaml +++ /dev/null @@ -1,6 +0,0 @@ -web_profiler: - toolbar: false - intercept_redirects: false - -framework: - profiler: { collect: false } diff --git a/tests/Application/config/packages/test_cached/doctrine.yaml b/tests/Application/config/packages/test_cached/doctrine.yaml deleted file mode 100644 index 4952860..0000000 --- a/tests/Application/config/packages/test_cached/doctrine.yaml +++ /dev/null @@ -1,16 +0,0 @@ -doctrine: - orm: - entity_managers: - default: - result_cache_driver: - type: memcached - host: localhost - port: 11211 - query_cache_driver: - type: memcached - host: localhost - port: 11211 - metadata_cache_driver: - type: memcached - host: localhost - port: 11211 diff --git a/tests/Application/config/packages/test_cached/fos_rest.yaml b/tests/Application/config/packages/test_cached/fos_rest.yaml deleted file mode 100644 index 2b4189d..0000000 --- a/tests/Application/config/packages/test_cached/fos_rest.yaml +++ /dev/null @@ -1,3 +0,0 @@ -fos_rest: - exception: - debug: true diff --git a/tests/Application/config/packages/test_cached/framework.yaml b/tests/Application/config/packages/test_cached/framework.yaml deleted file mode 100644 index e9dd6ee..0000000 --- a/tests/Application/config/packages/test_cached/framework.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../test/framework.yaml } 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/monolog.yaml b/tests/Application/config/packages/test_cached/monolog.yaml deleted file mode 100644 index 7e2b9e3..0000000 --- a/tests/Application/config/packages/test_cached/monolog.yaml +++ /dev/null @@ -1,6 +0,0 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: error diff --git a/tests/Application/config/packages/test_cached/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_channel.yaml b/tests/Application/config/packages/test_cached/sylius_channel.yaml deleted file mode 100644 index bab83ef..0000000 --- a/tests/Application/config/packages/test_cached/sylius_channel.yaml +++ /dev/null @@ -1,2 +0,0 @@ -sylius_channel: - debug: true diff --git a/tests/Application/config/packages/test_cached/sylius_theme.yaml b/tests/Application/config/packages/test_cached/sylius_theme.yaml deleted file mode 100644 index 4d34199..0000000 --- a/tests/Application/config/packages/test_cached/sylius_theme.yaml +++ /dev/null @@ -1,3 +0,0 @@ -sylius_theme: - sources: - test: ~ diff --git a/tests/Application/config/packages/test_cached/sylius_uploader.yaml b/tests/Application/config/packages/test_cached/sylius_uploader.yaml deleted file mode 100644 index cfa727e..0000000 --- a/tests/Application/config/packages/test_cached/sylius_uploader.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "../test/sylius_uploader.yaml" } diff --git a/tests/Application/config/packages/test_cached/twig.yaml b/tests/Application/config/packages/test_cached/twig.yaml deleted file mode 100644 index 8c6e0b4..0000000 --- a/tests/Application/config/packages/test_cached/twig.yaml +++ /dev/null @@ -1,2 +0,0 @@ -twig: - strict_variables: true diff --git a/tests/Application/config/packages/translation.yaml b/tests/Application/config/packages/translation.yaml deleted file mode 100644 index 1f4f966..0000000 --- a/tests/Application/config/packages/translation.yaml +++ /dev/null @@ -1,8 +0,0 @@ -framework: - default_locale: '%locale%' - translator: - paths: - - '%kernel.project_dir%/translations' - fallbacks: - - '%locale%' - - 'en' diff --git a/tests/Application/config/packages/twig.yaml b/tests/Application/config/packages/twig.yaml deleted file mode 100644 index 8545473..0000000 --- a/tests/Application/config/packages/twig.yaml +++ /dev/null @@ -1,12 +0,0 @@ -twig: - paths: ['%kernel.project_dir%/templates'] - debug: '%kernel.debug%' - strict_variables: '%kernel.debug%' - -services: - _defaults: - public: false - autowire: true - autoconfigure: true - - Twig\Extra\Intl\IntlExtension: ~ diff --git a/tests/Application/config/packages/validator.yaml b/tests/Application/config/packages/validator.yaml deleted file mode 100644 index 61807db..0000000 --- a/tests/Application/config/packages/validator.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - validation: - enable_annotations: true diff --git a/tests/Application/config/packages/webpack_encore.yaml b/tests/Application/config/packages/webpack_encore.yaml deleted file mode 100644 index 9bee248..0000000 --- a/tests/Application/config/packages/webpack_encore.yaml +++ /dev/null @@ -1,5 +0,0 @@ -webpack_encore: - output_path: '%kernel.project_dir%/public/build/default' - builds: - shop: '%kernel.project_dir%/public/build/shop' - admin: '%kernel.project_dir%/public/build/admin' diff --git a/tests/Application/config/routes.yaml b/tests/Application/config/routes.yaml deleted file mode 100644 index 6c3338a..0000000 --- a/tests/Application/config/routes.yaml +++ /dev/null @@ -1,2 +0,0 @@ -sylius_customer_reorder_plugin: - resource: "@SyliusCustomerReorderPlugin/Resources/config/app/reorder_routing.yml" diff --git a/tests/Application/config/routes/dev/web_profiler.yaml b/tests/Application/config/routes/dev/web_profiler.yaml deleted file mode 100644 index 3e79dc2..0000000 --- a/tests/Application/config/routes/dev/web_profiler.yaml +++ /dev/null @@ -1,7 +0,0 @@ -_wdt: - resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" - prefix: /_wdt - -_profiler: - resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" - prefix: /_profiler diff --git a/tests/Application/config/routes/liip_imagine.yaml b/tests/Application/config/routes/liip_imagine.yaml deleted file mode 100644 index 201cbd5..0000000 --- a/tests/Application/config/routes/liip_imagine.yaml +++ /dev/null @@ -1,2 +0,0 @@ -_liip_imagine: - resource: "@LiipImagineBundle/Resources/config/routing.yaml" diff --git a/tests/Application/config/routes/sylius_admin.yaml b/tests/Application/config/routes/sylius_admin.yaml deleted file mode 100644 index 1ba48d6..0000000 --- a/tests/Application/config/routes/sylius_admin.yaml +++ /dev/null @@ -1,3 +0,0 @@ -sylius_admin: - resource: "@SyliusAdminBundle/Resources/config/routing.yml" - prefix: /admin diff --git a/tests/Application/config/routes/sylius_api.yaml b/tests/Application/config/routes/sylius_api.yaml deleted file mode 100644 index ae01ffc..0000000 --- a/tests/Application/config/routes/sylius_api.yaml +++ /dev/null @@ -1,3 +0,0 @@ -sylius_api: - resource: "@SyliusApiBundle/Resources/config/routing.yml" - prefix: "%sylius.security.new_api_route%" diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml deleted file mode 100644 index 92eeae0..0000000 --- a/tests/Application/config/routes/sylius_shop.yaml +++ /dev/null @@ -1,14 +0,0 @@ -sylius_shop: - resource: "@SyliusShopBundle/Resources/config/routing.yml" - prefix: /{_locale} - requirements: - _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" - -sylius_shop_default_locale: - path: / - methods: [GET] - defaults: - _controller: sylius.controller.shop.locale_switch:switchAction 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.yaml b/tests/Application/config/services.yaml deleted file mode 100644 index 615506e..0000000 --- a/tests/Application/config/services.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# Put parameters here that don't need to change on each machine where the app is deployed -# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration -parameters: - locale: en_US diff --git a/tests/Application/config/services_test.yaml b/tests/Application/config/services_test.yaml deleted file mode 100644 index af40901..0000000 --- a/tests/Application/config/services_test.yaml +++ /dev/null @@ -1,8 +0,0 @@ -imports: - - { resource: "../../Behat/Resources/services.xml" } - - { 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_cached.yaml b/tests/Application/config/services_test_cached.yaml deleted file mode 100644 index 0de380e..0000000 --- a/tests/Application/config/services_test_cached.yaml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: "services_test.yaml" } diff --git a/tests/Application/package.json b/tests/Application/package.json deleted file mode 100644 index 32ccdc4..0000000 --- a/tests/Application/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "dependencies": { - "@babel/polyfill": "^7.0.0", - "chart.js": "^3.7.1", - "jquery": "^3.5.0", - "jquery.dirtyforms": "^2.0.0", - "lightbox2": "^2.9.0", - "semantic-ui-css": "^2.2.0", - "slick-carousel": "^1.8.1" - }, - "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/plugin-external-helpers": "^7.0.0", - "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/preset-env": "^7.18.10", - "@babel/register": "^7.0.0", - "@rollup/plugin-babel": "^5.3.1", - "@rollup/plugin-commonjs": "^22.0.2", - "@rollup/plugin-inject": "^4.0.4", - "@rollup/plugin-node-resolve": "^13.3.0", - "@semantic-ui-react/css-patch": "^1.1.2", - "@symfony/webpack-encore": "^3.1.0", - "babel-plugin-fast-async": "^6.1.2", - "babel-plugin-module-resolver": "^4.1.0", - "dedent": "^0.7.0", - "eslint": "^8.23.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-babel-module": "^5.3.1", - "eslint-plugin-import": "^2.26.0", - "fast-async": "^6.3.8", - "gulp": "^4.0.2", - "gulp-chug": "^0.5.1", - "gulp-concat": "^2.6.1", - "gulp-debug": "^4.0.0", - "gulp-if": "^3.0.0", - "gulp-livereload": "^4.0.2", - "gulp-order": "^1.2.0", - "gulp-sass": "^5.1.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-uglifycss": "^1.1.0", - "merge-stream": "^2.0.0", - "rollup": "^2.79.0", - "rollup-plugin-terser": "^7.0.2", - "sass": "^1.54.8", - "sass-loader": "^13.0.0", - "upath": "^2.0.1", - "yargs": "^17.5.1" - }, - "engines": { - "node": "^14 || ^16 || ^18" - }, - "engineStrict": true, - "scripts": { - "watch": "encore dev --watch", - "build": "encore dev", - "build:prod": "encore production", - "gulp": "gulp build", - "lint": "yarn lint:js", - "lint:js": "eslint gulpfile.babel.js src/Sylius/Bundle/AdminBundle/gulpfile.babel.js src/Sylius/Bundle/ShopBundle/gulpfile.babel.js src/Sylius/Bundle/UiBundle/Resources/private/js src/Sylius/Bundle/AdminBundle/Resources/private/js src/Sylius/Bundle/ShopBundle/Resources/private/js", - "postinstall": "semantic-ui-css-patch" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Sylius/Sylius.git" - }, - "author": "Paweł Jędrzejewski", - "license": "MIT" -} diff --git a/tests/Application/public/.htaccess b/tests/Application/public/.htaccess deleted file mode 100644 index 99ed00d..0000000 --- a/tests/Application/public/.htaccess +++ /dev/null @@ -1,25 +0,0 @@ -DirectoryIndex app.php - - - RewriteEngine On - - RewriteCond %{HTTP:Authorization} ^(.*) - RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] - - RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ - RewriteRule ^(.*) - [E=BASE:%1] - - RewriteCond %{ENV:REDIRECT_STATUS} ^$ - RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] - - RewriteCond %{REQUEST_FILENAME} -f - RewriteRule .? - [L] - - RewriteRule .? %{ENV:BASE}/index.php [L] - - - - - RedirectMatch 302 ^/$ /index.php/ - - diff --git a/tests/Application/public/favicon.ico b/tests/Application/public/favicon.ico deleted file mode 100644 index 592f7a8..0000000 Binary files a/tests/Application/public/favicon.ico and /dev/null differ diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php deleted file mode 100644 index 0a12655..0000000 --- a/tests/Application/public/index.php +++ /dev/null @@ -1,29 +0,0 @@ -handle($request); -$response->send(); -$kernel->terminate($request, $response); diff --git a/tests/Application/public/robots.txt b/tests/Application/public/robots.txt deleted file mode 100644 index 214e411..0000000 --- a/tests/Application/public/robots.txt +++ /dev/null @@ -1,4 +0,0 @@ -# www.robotstxt.org/ -# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 - -User-agent: * diff --git a/tests/Application/templates/.gitignore b/tests/Application/templates/.gitignore deleted file mode 100644 index e69de29..0000000 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 @@ - 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/translations/.gitignore b/tests/Application/translations/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js deleted file mode 100644 index 599e371..0000000 --- a/tests/Application/webpack.config.js +++ /dev/null @@ -1,49 +0,0 @@ -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/'); - -// Shop config -Encore - .setOutputPath('public/build/shop/') - .setPublicPath('/build/shop') - .addEntry('shop-entry', './assets/shop/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); - -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'; - -Encore.reset(); - -// Admin config -Encore - .setOutputPath('public/build/admin/') - .setPublicPath('/build/admin') - .addEntry('admin-entry', './assets/admin/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); - -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]; diff --git a/tests/Behat/Page/Cart/SummaryPage.php b/tests/Behat/Page/Cart/SummaryPage.php index a9c41e3..a063773 100644 --- a/tests/Behat/Page/Cart/SummaryPage.php +++ b/tests/Behat/Page/Cart/SummaryPage.php @@ -16,12 +16,12 @@ public function checkout(): void public function countFlashMessages(): int { - return count($this->getSession()->getPage()->findAll('css', '.sylius-flash-message')); + return count($this->getSession()->getPage()->findAll('css', '[data-test-sylius-flash-message]')); } public function doesFlashMessageWithTextExists(string $text): bool { - $notifications = $this->getSession()->getPage()->findAll('css', '.sylius-flash-message'); + $notifications = $this->getSession()->getPage()->findAll('css', '[data-test-sylius-flash-message]'); if (0 === count($notifications)) { return false; diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index 211e737..e6fa47a 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -9,7 +9,7 @@ - + diff --git a/tests/Behat/Resources/suites.yml b/tests/Behat/Resources/suites.yml index 0010d77..c20acd7 100644 --- a/tests/Behat/Resources/suites.yml +++ b/tests/Behat/Resources/suites.yml @@ -29,7 +29,7 @@ default: - sylius.behat.context.ui.shop.checkout.addressing filters: - tags: "@reordering && @ui" + tags: "@reordering&&@ui" reorders_application: contexts: @@ -62,4 +62,4 @@ default: - sylius.behat.context.ui.shop.checkout.addressing filters: - tags: "@reordering && @application" + tags: "@reordering&&@application" diff --git a/tests/Application/config/secrets/test/.gitignore b/tests/Functional/.gitignore similarity index 100% rename from tests/Application/config/secrets/test/.gitignore rename to tests/Functional/.gitignore diff --git a/tests/Application/config/secrets/test_cached/.gitignore b/tests/Integration/.gitignore similarity index 100% rename from tests/Application/config/secrets/test_cached/.gitignore rename to tests/Integration/.gitignore diff --git a/tests/TestApplication/.env b/tests/TestApplication/.env new file mode 100644 index 0000000..d4134cf --- /dev/null +++ b/tests/TestApplication/.env @@ -0,0 +1,7 @@ +DATABASE_URL=mysql://root@127.0.0.1/sylius_customer_reorder_%kernel.environment% + +BEHAT_BASE_URL="https://127.0.0.1:8080/" + +SYLIUS_TEST_APP_BUNDLES_PATH="tests/TestApplication/config/bundles.php" +SYLIUS_TEST_APP_CONFIGS_TO_IMPORT="@SyliusCustomerReorderPlugin/tests/TestApplication/config/config.yaml" +SYLIUS_TEST_APP_ROUTES_TO_IMPORT="@SyliusCustomerReorderPlugin/tests/TestApplication/config/routes.yaml" diff --git a/tests/TestApplication/.env.test b/tests/TestApplication/.env.test new file mode 100644 index 0000000..8195900 --- /dev/null +++ b/tests/TestApplication/.env.test @@ -0,0 +1 @@ +DATABASE_URL=mysql://root@127.0.0.1/sylius_customer_reorder_%kernel.environment% diff --git a/tests/TestApplication/config/bundles.php b/tests/TestApplication/config/bundles.php new file mode 100644 index 0000000..8b22bd4 --- /dev/null +++ b/tests/TestApplication/config/bundles.php @@ -0,0 +1,5 @@ + ['all' => true], +]; diff --git a/tests/TestApplication/config/config.yaml b/tests/TestApplication/config/config.yaml new file mode 100644 index 0000000..cefda5f --- /dev/null +++ b/tests/TestApplication/config/config.yaml @@ -0,0 +1,28 @@ +imports: + - { resource: "@SyliusCustomerReorderPlugin/config/config.yaml" } + - { resource: "services_test.php" } + +doctrine: + orm: + entity_managers: + default: + mappings: + TestApplication: + is_bundle: false + type: attribute + dir: '%kernel.project_dir%/../../../tests/TestApplication/src/Entity' + prefix: Tests\Sylius\CustomerReorderPlugin + +sylius_grid: + grids: + sylius_shop_account_order: + actions: + item: + reorder: + type: reorder + label: sylius_customer_reorder_plugin.ui.reorder + options: + link: + route: sylius_reorder_plugin_reorder + parameters: + id: resource.id diff --git a/tests/TestApplication/config/routes.yaml b/tests/TestApplication/config/routes.yaml new file mode 100644 index 0000000..0233c05 --- /dev/null +++ b/tests/TestApplication/config/routes.yaml @@ -0,0 +1,2 @@ +sylius_customer_reorder_plugin: + resource: "@SyliusCustomerReorderPlugin/config/app_routing.yaml" diff --git a/tests/TestApplication/config/services_test.php b/tests/TestApplication/config/services_test.php new file mode 100644 index 0000000..ae037d9 --- /dev/null +++ b/tests/TestApplication/config/services_test.php @@ -0,0 +1,12 @@ +env(), 'test')) { + $container->import('../../../vendor/sylius/sylius/src/Sylius/Behat/Resources/config/services.xml'); + $container->import('@SyliusCustomerReorderPlugin/tests/Behat/Resources/services.xml'); + } +}; diff --git a/tests/Application/config/serialization/.gitignore b/tests/TestApplication/src/Entity/.gitignore similarity index 100% rename from tests/Application/config/serialization/.gitignore rename to tests/TestApplication/src/Entity/.gitignore diff --git a/tests/Application/src/Entity/.gitignore b/tests/Unit/.gitignore similarity index 100% rename from tests/Application/src/Entity/.gitignore rename to tests/Unit/.gitignore diff --git a/src/Resources/translations/flashes.en.yml b/translations/flashes.en.yml similarity index 100% rename from src/Resources/translations/flashes.en.yml rename to translations/flashes.en.yml diff --git a/src/Resources/translations/flashes.it.yml b/translations/flashes.it.yml similarity index 100% rename from src/Resources/translations/flashes.it.yml rename to translations/flashes.it.yml diff --git a/src/Resources/translations/messages.en.yml b/translations/messages.en.yml similarity index 100% rename from src/Resources/translations/messages.en.yml rename to translations/messages.en.yml diff --git a/src/Resources/translations/messages.it.yml b/translations/messages.it.yml similarity index 100% rename from src/Resources/translations/messages.it.yml rename to translations/messages.it.yml