Skip to content

Commit ce8d47b

Browse files
authored
Merge pull request #6 from mpysiak/add-test-application
Add test application
2 parents a17de09 + 88d8d45 commit ce8d47b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+80
-1022
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,10 @@ jobs:
6969
name: Install certificates
7070
run: symfony server:ca:install
7171

72-
-
73-
name: Run Chrome Headless
74-
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 &
75-
76-
-
77-
name: Run webserver
78-
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)
79-
8072
-
8173
name: Get Composer cache directory
8274
id: composer-cache
83-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
75+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8476

8577
-
8678
name: Cache Composer
@@ -133,40 +125,48 @@ jobs:
133125
134126
-
135127
name: Install JS dependencies
136-
run: (cd tests/Application && yarn install)
128+
run: cd vendor/sylius/test-application && yarn install
137129

138130
-
139131
name: Prepare test application database
140132
run: |
141-
(cd tests/Application && bin/console doctrine:database:create -vvv)
142-
(cd tests/Application && bin/console doctrine:migrations:migrate -vvv)
133+
vendor/bin/console doctrine:database:create -vvv
134+
vendor/bin/console doctrine:migrations:migrate -vvv
143135
144136
-
145137
name: Prepare test application assets
146138
run: |
147-
(cd tests/Application && bin/console assets:install public -vvv)
148-
(cd tests/Application && yarn prod)
139+
vendor/bin/console assets:install -vvv
140+
cd vendor/sylius/test-application && yarn encore dev
149141
150142
-
151143
name: Prepare test application cache
152-
run: (cd tests/Application && bin/console cache:warmup -vvv)
144+
run: vendor/bin/console cache:warmup -vvv
153145

154146
-
155147
name: Load fixtures in test application
156-
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
148+
run: vendor/bin/console sylius:fixtures:load -n
157149

158150
-
159151
name: Validate composer.json
160152
run: composer validate --ansi --strict
161153

162154
-
163155
name: Validate database schema
164-
run: (cd tests/Application && bin/console doctrine:schema:validate)
156+
run: vendor/bin/console doctrine:schema:validate
165157

166158
-
167159
name: Run PHPSpec
168160
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
169161

162+
-
163+
name: Run Chrome Headless
164+
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 &
165+
166+
-
167+
name: Run webserver
168+
run: symfony server:start --port=8080 --daemon
169+
170170
-
171171
name: Run PHPUnit
172172
run: vendor/bin/phpunit --colors=always

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88

99
/behat.yml
1010
/phpunit.xml
11-
tests/Application/yarn.lock
11+
12+
/tests/TestApplication/.env.local
13+
/tests/TestApplication/.env.*.local
14+
15+
.phpunit.result.cache

behat.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ default:
3232
show_auto: false
3333

3434
FriendsOfBehat\SymfonyExtension:
35-
bootstrap: tests/Application/config/bootstrap.php
35+
bootstrap: vendor/sylius/test-application/config/bootstrap.php
3636
kernel:
37-
class: Tests\Sylius\WishlistPlugin\Application\Kernel
37+
class: Sylius\TestApplication\Kernel
3838

3939
FriendsOfBehat\VariadicExtension: ~
4040

composer.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"phpspec/phpspec": "^7.0",
2525
"phpunit/phpunit": "^9.5",
2626
"sylius/sylius-rector": "^2.0",
27+
"sylius/test-application": "^2.0.0@alpha",
2728
"sylius-labs/coding-standard": "^4.4",
2829
"sylius-labs/suite-tags-extension": "~0.2",
2930
"symfony/browser-kit": "^6.4 || ^7.1",
@@ -46,29 +47,30 @@
4647
}
4748
},
4849
"autoload-dev": {
49-
"classmap": ["tests/Application/Kernel.php"],
5050
"psr-4": {
5151
"Sylius\\WishlistPlugin\\": "src/",
5252
"Tests\\Sylius\\WishlistPlugin\\": "tests/",
53-
"Sylius\\Tests\\Api\\": ["vendor/sylius/sylius/tests/Api/"]
53+
"Sylius\\Tests\\Api\\": "vendor/sylius/sylius/tests/Api/"
5454
}
5555
},
5656
"config": {
5757
"allow-plugins": {
5858
"phpstan/extension-installer": true,
59-
"composer/package-versions-deprecated": true,
6059
"dealerdirect/phpcodesniffer-composer-installer": true,
6160
"symfony/thanks": true,
62-
"php-http/discovery": true
61+
"php-http/discovery": true,
62+
"symfony/flex": true,
63+
"symfony/runtime": true
6364
},
6465
"preferred-install": {
6566
"sylius/sylius": "source"
6667
}
6768
},
68-
"scripts": {
69-
"auto-scripts": {
70-
"cache:clear": "symfony-cmd",
71-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
72-
}
69+
"extra": {
70+
"symfony": {
71+
"allow-contrib": false,
72+
"require": "^7.1"
73+
},
74+
"public-dir": "vendor/sylius/test-application/public"
7375
}
7476
}

config/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
imports:
22
- { resource: "@SyliusWishlistPlugin/config/twig_hooks/**/*.yaml" }
3+
4+
api_platform:
5+
mapping:
6+
paths:
7+
- '%sylius_wishlist_api_platform_mapping_path%'

phpunit.xml.dist

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
backupGlobals="false"
6-
colors="true"
7-
bootstrap="tests/Application/config/bootstrap.php"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
bootstrap="vendor/sylius/test-application/config/bootstrap.php"
88
>
99
<php>
10-
<ini name="error_reporting" value="-1" />
11-
1210
<env name="APP_SECRET" value="''" />
1311
<env name="APP_ENV" value="test"/>
14-
<env name="APP_DEBUG" value="0"/>
15-
<env name="SHELL_VERBOSITY" value="-1" />
1612

17-
<server name="KERNEL_CLASS" value="Tests\Sylius\WishlistPlugin\Application\Kernel" />
18-
<server name="KERNEL_CLASS_PATH" value="/tests/Application/Kernel.php" />
13+
<server name="KERNEL_CLASS" value="Sylius\TestApplication\Kernel" />
1914
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true"/>
20-
<server name="SHELL_VERBOSITY" value="-1" />
21-
<server name="ESCAPE_JSON" value="true" />
2215
</php>
2316

2417
<testsuites>

tests/Application/.env

Lines changed: 0 additions & 44 deletions
This file was deleted.

tests/Application/.env.test

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/Application/.eslintrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/Application/.gitignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)