Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- 8.3
symfony:
- '6.4.*'
- '7.2.*'
env:
APP_ENV: test
steps:
Expand Down Expand Up @@ -59,7 +58,7 @@ jobs:
id: end-of-setup
-
name: 'ECS - Run'
run: 'if [ -f ruleset/ecs.php ]; then vendor/bin/ecs check src/ tests/Behat/ --no-progress-bar -c ruleset/ecs.php ; else echo Ecs ruleset file does not exist, skipping step ; fi'
run: 'if [ -f ruleset/ecs.php ]; then vendor/bin/ecs check src/ --no-progress-bar -c ruleset/ecs.php ; else echo Ecs ruleset file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
name: 'PHPStan - Run'
Expand All @@ -77,7 +76,3 @@ jobs:
name: 'GrumPHP - Run'
run: 'if [ -f grumphp.yml ]; then vendor/bin/grumphp run ; else echo Grumphp ruleset file does not exist, skipping step ; fi'
if: 'always() && steps.end-of-setup.outcome == ''success'''
-
uses: symfonycorp/security-checker-action@v5
if: 'always() && steps.end-of-setup.outcome == ''success'''
continue-on-error: true
44 changes: 7 additions & 37 deletions .github/workflows/sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ jobs:
php:
- 8.2
- 8.3
- 8.4
sylius:
- 2.0.0
- 2.1.0
- 2.2.0
symfony:
- 6.4
- 7.2
- 7.4
node:
- 20.x
env:
Expand Down Expand Up @@ -77,48 +79,16 @@ jobs:
restore-keys: "node-${{ matrix.node }}-yarn-\n"
-
name: 'Install Sylius-Standard and Plugin'
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }} PHP_VERSION=${{ matrix.php }}'
-
name: 'Output PHP version for Symfony CLI'
working-directory: ./tests/Application
run: 'php -v | head -n 1 | awk ''{ print $2 }'' > .php-version'
-
name: 'Install certificates'
working-directory: ./tests/Application
run: 'symfony server:ca:install'
-
name: 'Run Chrome headless'
working-directory: ./tests/Application
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=''*'' https://127.0.0.1 > /dev/null 2>&1 &'
-
name: 'Run webserver'
working-directory: ./tests/Application
run: 'symfony server:start --port=8080 --dir=public --daemon'
id: end-of-setup-sylius
run: 'make install -e SYLIUS_VERSION=${{ matrix.sylius }} SYMFONY_VERSION=${{ matrix.symfony }}'
-
name: 'Doctrine Schema Validate - Run'
working-directory: ./tests/Application
run: 'php bin/console doctrine:schema:validate --skip-sync'
run: 'php vendor/bin/console doctrine:schema:validate --skip-sync'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Run PHPUnit'
run: 'make phpunit'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Configure Behat'
run: 'make behat-configure'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
name: 'Run behat'
working-directory: ./tests/Application
run: 'vendor/bin/behat --strict --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction --rerun'
if: 'always() && steps.end-of-setup-sylius.outcome == ''success'''
-
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
path: ./tests/Application/etc/build

services:
mariadb:
image: 'mariadb:10.4.11'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
/.phpunit.result.cache

/.idea/

/tests/TestApplication/.env.local
/tests/TestApplication/.env.*.local
/var/
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
From the plugin root directory, run the following commands:

```bash
$ make install -e SYLIUS_VERSION=XX SYMFONY_VERSION=YY PHP_VERSION=ZZ
$ make install -e SYLIUS_VERSION=XX SYMFONY_VERSION=YY
```

Default values : XX=2.0 and YY=7.1 and ZZ=8.3
Default values : XX=2.1 and YY=6.4

To be able to set up the plugin database, remember to configure you database credentials
To be able to set up the plugin database, remember to configure your database credentials
in `install/Application/.env.local` and `install/Application/.env.test.local`.

To reset test environment:
Expand Down Expand Up @@ -39,11 +39,11 @@ $ make reset
- Using `test` environment:

```bash
$ (cd tests/Application && bin/console server:run -d public -e test)
$ APP_ENV=test symfony server:start -d
```

- Using `dev` environment:

```bash
$ (cd tests/Application && bin/console server:run -d public -e dev)
$ symfony server:start -d
```
75 changes: 15 additions & 60 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,87 +1,42 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
COMPOSER_ROOT=composer
TEST_DIRECTORY=tests/Application
INSTALL_DIRECTORY=install/Application
CONSOLE=cd ${TEST_DIRECTORY} && php bin/console -e test
COMPOSER=cd ${TEST_DIRECTORY} && composer
YARN=cd ${TEST_DIRECTORY} && yarn

SYLIUS_VERSION=2.0
SYMFONY_VERSION=7.1
PHP_VERSION=8.3
CONSOLE=vendor/bin/console
COMPOSER=composer
SYLIUS_VERSION=2.1.0
SYMFONY_VERSION=6.4
PLUGIN_NAME=synolia/sylius-mail-tester-plugin

###
### DEVELOPMENT
### ¯¯¯¯¯¯¯¯¯¯¯

install: sylius ## Install Plugin on Sylius [SYLIUS_VERSION=1.12.0] [SYMFONY_VERSION=6.1] [PHP_VERSION=8.1]
install: sylius ## Install all dependencies with [SYLIUS_VERSION=2.1.0] [SYMFONY_VERSION=6.4]
.PHONY: install

reset: ## Remove dependencies
ifneq ("$(wildcard ${TEST_DIRECTORY}/bin/console)","")
${CONSOLE} doctrine:database:drop --force --if-exists || true
endif
rm -rf ${TEST_DIRECTORY}
rm -rf vendor
rm composer.lock
.PHONY: reset

phpunit: phpunit-configure phpunit-run ## Run PHPUnit
phpunit: ## Run PHPUnit tests
./vendor/bin/phpunit --testdox
.PHONY: phpunit

###
### OTHER
### ¯¯¯¯¯¯

sylius: sylius-standard update-dependencies install-plugin install-sylius
sylius: install-sylius
.PHONY: sylius

sylius-standard:
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER_ROOT} create-project sylius/sylius-standard:${SYLIUS_VERSION} ${TEST_DIRECTORY} --no-install --no-scripts
else
${COMPOSER_ROOT} create-project sylius/sylius-standard ${TEST_DIRECTORY} "~${SYLIUS_VERSION}" --no-install --no-scripts
endif
${COMPOSER} config allow-plugins true
ifeq ($(shell [[ $(SYLIUS_VERSION) == *dev ]] && echo true ),true)
${COMPOSER} require sylius/sylius:"${SYLIUS_VERSION}"
else
${COMPOSER} require sylius/sylius:"~${SYLIUS_VERSION}"
endif

update-dependencies:
${COMPOSER} config extra.symfony.require "~${SYMFONY_VERSION}"
${COMPOSER} require --dev donatj/mock-webserver:^2.1 --no-scripts --no-update
${COMPOSER} require symfony/asset:~${SYMFONY_VERSION} --no-scripts --no-update
${COMPOSER} update --no-progress -n

install-plugin:
${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}'
${COMPOSER} config extra.symfony.allow-contrib true
${COMPOSER} config minimum-stability "dev"
${COMPOSER} config prefer-stable true
${COMPOSER} req ${PLUGIN_NAME}:* --prefer-source --no-scripts
cp -r ${INSTALL_DIRECTORY} tests
cp -r tests/data/* ${TEST_DIRECTORY}/

install-sylius:
${CONSOLE} sylius:install -n -s default
${YARN} install
${YARN} build
${CONSOLE} cache:clear

phpunit-configure:
cp phpunit.xml.dist ${TEST_DIRECTORY}/phpunit.xml

phpunit-run:
cd ${TEST_DIRECTORY} && ./vendor/bin/phpunit
@echo "Installing Sylius ${SYLIUS_VERSION} using TestApplication"
${COMPOSER} config extra.symfony.require "^${SYMFONY_VERSION}"
${COMPOSER} install
${COMPOSER} require --dev sylius/test-application:"~${SYLIUS_VERSION}@alpha" -n -W
${COMPOSER} test-application:install

behat-configure: ## Configure Behat
(cd ${TEST_DIRECTORY} && cp behat.yml.dist behat.yml)
(cd ${TEST_DIRECTORY} && sed -i "s#vendor/sylius/sylius/src/Sylius/Behat/Resources/config/suites.yml#vendor/${PLUGIN_NAME}/tests/Behat/Resources/suites.yml#g" behat.yml)
(cd ${TEST_DIRECTORY} && sed -i "s#vendor/sylius/sylius/features#vendor/${PLUGIN_NAME}/features#g" behat.yml)
(cd ${TEST_DIRECTORY} && sed -i '2i \ \ \ \ - { resource: "../vendor/${PLUGIN_NAME}/tests/Behat/Resources/services.yaml" }' config/services_test.yaml)
${CONSOLE} cache:clear

grumphp: ## Run GrumPHP
vendor/bin/grumphp run
Expand Down
1 change: 1 addition & 0 deletions assets/admin/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Mandatory by test application but useless
2 changes: 2 additions & 0 deletions assets/controllers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
1 change: 1 addition & 0 deletions assets/shop/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Mandatory by test application but useless
61 changes: 0 additions & 61 deletions behat.yml.dist

This file was deleted.

Loading