Skip to content

Commit 1cab1af

Browse files
committed
refactor: src/Test/Behat as a subpackage
1 parent ff2aaa6 commit 1cab1af

File tree

67 files changed

+470
-123
lines changed

Some content is hidden

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

67 files changed

+470
-123
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/phpunit-10.xml.dist export-ignore
2020
/phpunit-paratest.xml.dist export-ignore
2121
/psalm.xml export-ignore
22+
/src/Behat export-ignore
2223
/stubs export-ignore
2324
/symfony.lock export-ignore
2425
/tests export-ignore

.github/workflows/behat.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ on:
44
push:
55
paths: &paths
66
- .github/workflows/behat.yml
7-
- bin/tools/behat
8-
- src/Behat/**
9-
- tests/Behat/**
10-
- behat.yml
11-
- composer.json
7+
- src/Test/Behat/**
128
pull_request:
139
paths: *paths
1410
schedule:
1511
- cron: '0 0 1,16 * *'
1612

13+
defaults:
14+
run:
15+
shell: bash
16+
working-directory: ./src/Test/Behat
17+
1718
concurrency:
1819
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1920
cancel-in-progress: true
@@ -51,16 +52,12 @@ jobs:
5152
- name: Install dependencies
5253
uses: ramsey/composer-install@v2
5354
with:
55+
working-directory: "src/Test/Behat"
5456
dependency-versions: ${{ matrix.deps }}
5557
composer-options: --prefer-dist
5658
env:
5759
SYMFONY_REQUIRE: ${{ matrix.symfony }}
5860

59-
- name: Install Behat
60-
run: composer bin behat update ${{ matrix.deps == 'lowest' && '--prefer-lowest' || '' }} --prefer-dist
61-
env:
62-
SYMFONY_REQUIRE: ${{ matrix.symfony }}
63-
6461
- name: "Main test suite: reset DB at scenario level, with Dama support"
6562
run: vendor/bin/behat --colors -vvv
6663

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ jobs:
4848
run: composer bin phpstan install
4949

5050
- name: Install PHPBench & Behat
51-
run: |
52-
composer bin phpbench install
53-
composer bin behat install
51+
run: composer bin phpbench install
5452

5553
- name: Run PHPStan
5654
run: bin/tools/phpstan/vendor/phpstan/phpstan/phpstan analyse

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"symfony/polyfill-php85": "^1.33",
2424
"symfony/property-access": "^6.4|^7.0|^8.0",
2525
"symfony/property-info": "^6.4|^7.0|^8.0",
26-
"symfony/string": "^6.4|^7.0|^8.0",
2726
"symfony/var-exporter": "^6.4.9|~7.0.9|^7.1.2|^8.0",
2827
"zenstruck/assert": "^1.4"
2928
},
@@ -47,7 +46,6 @@
4746
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
4847
"symfony/maker-bundle": "^1.55",
4948
"symfony/phpunit-bridge": "^6.4.26|^7.0|^8.0",
50-
"symfony/polyfill-php80": "^1.16",
5149
"symfony/routing": "^6.4|^7.0|^8.0",
5250
"symfony/runtime": "^6.4|^7.0|^8.0",
5351
"symfony/translation-contracts": "^3.4",
@@ -66,7 +64,8 @@
6664
"src/functions.php",
6765
"src/Persistence/functions.php",
6866
"src/symfony_console.php"
69-
]
67+
],
68+
"exclude-from-classmap": ["src/Test/Behat/"]
7069
},
7170
"autoload-dev": {
7271
"psr-4": {

phpstan.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ parameters:
2020

2121
bootstrapFiles:
2222
- bin/tools/phpbench/vendor/autoload.php
23-
- bin/tools/behat/vendor/autoload.php
2423

2524
ignoreErrors:
2625
# suppress strange behavior of PHPStan where it considers proxy() return type as *NEVER*
@@ -76,3 +75,5 @@ parameters:
7675
- ./src/Maker/Factory/LegacyORMDefaultPropertiesGuesser.php
7776
- ./src/Maker/Factory/DoctrineScalarFieldsDefaultPropertiesGuesser.php
7877
- ./src/ORM/OrmV2PersistenceStrategy.php
78+
79+
- ./src/Test/Behat/

phpunit-10.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
defaultTestSuite="main">
1212
<php>
1313
<ini name="error_reporting" value="-1"/>
14-
<server name="KERNEL_CLASS" value="Zenstruck\Foundry\Tests\Fixture\TestKernel"/>
14+
<server name="KERNEL_CLASS" value="Zenstruck\Foundry\Test\Behat\Tests\Fixture\BehatTestKernel"/>
1515
<server name="SHELL_VERBOSITY" value="-1"/>
1616
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
1717
<env name="APP_ENV" value="test"/>

src/Test/Behat/.env.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'

src/Test/Behat/.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto
2+
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/behat.yml export-ignore
6+
/features export-ignore
7+
/symfony.lock export-ignore
8+
/tests export-ignore

src/Test/Behat/.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/composer.lock
2+
/vendor/
3+
/var/
4+
/.env.local
5+
6+
###> symfony/framework-bundle ###
7+
/.env.local
8+
/.env.local.php
9+
/.env.*.local
10+
/config/secrets/prod/prod.decrypt.private.php
11+
/public/bundles/
12+
/var/
13+
/vendor/
14+
###< symfony/framework-bundle ###
15+
16+
###> phpunit/phpunit ###
17+
/phpunit.xml
18+
/.phpunit.cache/
19+
###< phpunit/phpunit ###

src/Test/Behat/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Behat extension for Foundry
2+
3+
This is a subpackage of [Foundry](https://github.com/zenstruck/foundry).
4+
5+
Please open any issue or pull request on the main repository.
6+
7+
See docs at: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#behat-integration

0 commit comments

Comments
 (0)