Skip to content

Commit 776cd32

Browse files
Switch to new TestApplication with Sylius 1.14 (#379)
2 parents a601647 + 26cc781 commit 776cd32

File tree

95 files changed

+82
-1095
lines changed

Some content is hidden

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

95 files changed

+82
-1095
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
APP_ENV: test
5454
DATABASE_URL: ${{ matrix.database == 'mysql' && format('mysql://root:root@127.0.0.1/sylius?serverVersion={0}', matrix.mysql) || format('pgsql://postgres:postgres@127.0.0.1/sylius?serverVersion={0}', matrix.postgres) }}
5555
TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}"
56+
TEST_SYLIUS_INVOICING_PDF_GENERATION_DISABLED: ${{ matrix.wkhtmltopdf == false }}
5657

5758
steps:
5859
-
@@ -113,11 +114,9 @@ jobs:
113114
sudo dpkg -i wkhtmltox_${{ matrix.wkhtmltopdf }}.jammy_amd64.deb
114115
115116
-
116-
name: Disable PDF generation
117+
name: Disable running Behat scenarios for PDF generation
117118
if: matrix.wkhtmltopdf == false
118-
run: |
119-
mv tests/Application/etc/sylius_invoicing_pdf_generation_disabled.yaml tests/Application/config/packages
120-
sed -i 's/pdf_generation_disabled/pdf_generation_enabled/g' behat.yml.dist
119+
run: sed -i 's/pdf_generation_disabled/pdf_generation_enabled/g' behat.yml.dist
121120

122121
-
123122
name: Get Composer cache directory
@@ -166,27 +165,27 @@ jobs:
166165
167166
-
168167
name: Install JS dependencies
169-
run: (cd tests/Application && yarn install)
168+
run: (cd vendor/sylius/test-application && yarn install)
170169

171170
-
172171
name: Prepare test application database
173172
run: |
174-
(cd tests/Application && bin/console doctrine:database:create -vvv)
175-
(cd tests/Application && bin/console doctrine:migrations:migrate -n -vvv -q)
173+
vendor/bin/console doctrine:database:create -vvv
174+
vendor/bin/console doctrine:migrations:migrate -n -vvv -q
176175
177176
-
178177
name: Prepare test application assets
179178
run: |
180-
(cd tests/Application && bin/console assets:install public -vvv)
181-
(cd tests/Application && yarn build:prod)
179+
vendor/bin/console assets:install public -vvv
180+
(cd vendor/sylius/test-application && yarn build:prod)
182181
183182
-
184183
name: Prepare test application cache
185-
run: (cd tests/Application && bin/console cache:warmup -vvv)
184+
run: vendor/bin/console cache:warmup -vvv
186185

187186
-
188187
name: Load fixtures in test application
189-
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
188+
run: vendor/bin/console sylius:fixtures:load -n
190189

191190
-
192191
name: Validate composer.json
@@ -221,6 +220,7 @@ jobs:
221220
uses: actions/upload-artifact@v4
222221
if: failure()
223222
with:
224-
name: Behat logs
223+
name: Behat logs - ${{ github.run_id }}-${{ github.run_number }}
225224
path: etc/build/
226225
if-no-files-found: ignore
226+
overwrite: true

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
/etc/build/*
99
!/etc/build/.gitkeep
1010

11-
/tests/Application/yarn.lock
12-
/tests/Application/private/invoices/*
11+
/tests/TestApplication/.env.local
12+
/tests/TestApplication/.env.*.local
13+
/var/

tests/Application/config/api_platform/.gitignore renamed to assets/admin/entrypoint.js

File renamed without changes.

behat.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ default:
2626
show_auto: false
2727

2828
FriendsOfBehat\SymfonyExtension:
29-
bootstrap: tests/Application/config/bootstrap.php
29+
bootstrap: vendor/sylius/test-application/config/bootstrap.php
3030
kernel:
31-
class: Tests\Sylius\InvoicingPlugin\Application\Kernel
31+
class: Sylius\TestApplication\Kernel
3232

3333
FriendsOfBehat\VariadicExtension: ~
3434

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"phpstan/phpstan-webmozart-assert": "^1.2",
4646
"phpunit/phpunit": "^9.5",
4747
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
48+
"sylius/test-application": "^1.14.0@alpha",
4849
"sylius-labs/coding-standard": "^4.4",
4950
"symfony/browser-kit": "^5.4.21 || ^6.4",
5051
"symfony/debug-bundle": "^5.4.21 || ^6.4",
@@ -61,7 +62,6 @@
6162
},
6263
"autoload-dev": {
6364
"psr-4": {
64-
"Tests\\Sylius\\InvoicingPlugin\\Application\\": "tests/Application/src/",
6565
"Tests\\Sylius\\InvoicingPlugin\\Unit\\": "tests/Unit/"
6666
}
6767
},
@@ -78,13 +78,15 @@
7878
"php-http/discovery": true,
7979
"phpstan/extension-installer": true,
8080
"symfony/flex": true,
81+
"symfony/runtime": false,
8182
"symfony/thanks": false
8283
}
8384
},
8485
"extra": {
8586
"branch-alias": {
8687
"dev-1.0": "1.0-dev"
87-
}
88+
},
89+
"public-dir": "vendor/sylius/test-application/public"
8890
},
8991
"prefer-stable": true
9092
}

node_modules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tests/Application/node_modules
1+
vendor/sylius/test-application/node_modules

phpstan.neon

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ parameters:
99
# Makes PHPStan crash
1010
- 'src/DependencyInjection/Configuration.php'
1111

12-
# Test dependencies
13-
- 'tests/Application/app/**.php'
14-
- 'tests/Application/src/**.php'
15-
1612
ignoreErrors:
1713
- identifier: missingType.generics
1814
- identifier: missingType.iterableValue

phpunit.xml.dist

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

3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.1/phpunit.xsd"
5-
colors="true"
6-
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"
8+
>
79
<testsuites>
810
<testsuite name="SyliusInvoicingPlugin Test Suite">
911
<directory>tests</directory>
@@ -16,6 +18,6 @@
1618
<env name="APP_ENV" value="test"/>
1719
<env name="SHELL_VERBOSITY" value="-1" />
1820

19-
<server name="KERNEL_CLASS" value="Tests\Sylius\InvoicingPlugin\Application\Kernel" />
21+
<server name="KERNEL_CLASS" value="Sylius\TestApplication\Kernel" />
2022
</php>
2123
</phpunit>

tests/Application/.env

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

0 commit comments

Comments
 (0)