Skip to content

Commit 00c164d

Browse files
committed
fix(behat): make the CI green
1 parent 5fe1f79 commit 00c164d

File tree

16 files changed

+37
-14
lines changed

16 files changed

+37
-14
lines changed

.github/workflows/behat.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
deps: [ highest, lowest ]
3131
env:
3232
DATABASE_URL: 'sqlite:///%kernel.project_dir%/var/data.db'
33+
USE_DAMA_DOCTRINE_TEST_BUNDLE: 1
34+
USE_PHP_84_LAZY_OBJECTS: 1
35+
MONGO_URL: ''
3336
steps:
3437
- name: Checkout code
3538
uses: actions/checkout@v3
@@ -59,25 +62,25 @@ jobs:
5962
SYMFONY_REQUIRE: ${{ matrix.symfony }}
6063

6164
- name: "Main test suite: reset DB at scenario level, with Dama support"
62-
run: vendor/bin/behat
65+
run: vendor/bin/behat --colors -vvv
6366

6467
- name: "Main test suite: reset DB at scenario level, without Dama support"
65-
run: vendor/bin/behat --profile=main-no-dama
68+
run: vendor/bin/behat --colors -vvv --profile=main-no-dama
6669

6770
- name: "Main test suite: reset DB at scenario level, with native Dama extension"
68-
run: vendor/bin/behat --profile=main-native-dama --tags='~@skip-with-native-dama'
71+
run: vendor/bin/behat --colors -vvv --profile=main-native-dama --tags='~@skip-with-native-dama'
6972

7073
- name: Manual reset DB
71-
run: vendor/bin/behat --profile=reset-manual
74+
run: vendor/bin/behat --colors -vvv --profile=reset-manual
7275

7376
- name: Manual reset DB and Dama support
74-
run: vendor/bin/behat --profile=reset-manual-dama
77+
run: vendor/bin/behat --colors -vvv --profile=reset-manual-dama
7578

7679
- name: Reset DB at feature level
77-
run: vendor/bin/behat --profile=reset-feature
80+
run: vendor/bin/behat --colors -vvv --profile=reset-feature
7881

7982
- name: Reset DB at feature level with Dama support
80-
run: vendor/bin/behat --profile=reset-feature-dama
83+
run: vendor/bin/behat --colors -vvv --profile=reset-feature-dama
8184

8285
- name: Reset DB disabled
83-
run: vendor/bin/behat --profile=reset-disabled
86+
run: vendor/bin/behat --colors -vvv --profile=reset-disabled

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
253253
- name: Test
254254
run: |
255-
vendor/bin/phpunit tests/Unit
255+
vendor/bin/phpunit -c phpunit-10.xml.dist tests/Unit
256256
257257
test-with-paratest:
258258
name: Test with paratest

bin/tools/behat/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"friends-of-behat/mink-extension": "^2.0",
66
"friends-of-behat/symfony-extension": "^2.0",
77
"symfony/flex": "^2.10",
8-
"yceruto/behat-extension": "^1.0"
8+
"yceruto/behat-extension": "^1.0.2",
9+
"symfony/polyfill-php84": "^1.33",
10+
"symfony/polyfill-php85": "^1.33"
911
},
1012
"config": {
1113
"allow-plugins": {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
4848
"symfony/maker-bundle": "^1.55",
4949
"symfony/phpunit-bridge": "^6.4.26|^7.0|^8.0",
50+
"symfony/polyfill-php80": "^1.16",
5051
"symfony/routing": "^6.4|^7.0|^8.0",
5152
"symfony/runtime": "^6.4|^7.0|^8.0",
5253
"symfony/translation-contracts": "^3.4",

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ Installation
27022702
27032703
$ composer require --dev behat/behat friends-of-behat/symfony-extension
27042704
2705-
2. Enable the Foundry extension in your ``behat.yml``:
2705+
2. Enable the Foundry extension in your ``behat.yaml``:
27062706

27072707
.. code-block:: yaml
27082708

phpunit-10.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<testsuite name="main">
2121
<directory>tests</directory>
2222
<exclude>tests/Integration/ResetDatabase</exclude>
23+
<exclude>tests/Unit/Test/Behat</exclude>
24+
<exclude>tests/Unit/Integration/Behat</exclude>
2325
</testsuite>
2426
<testsuite name="reset-database">
2527
<directory>tests/Integration/ResetDatabase</directory>

phpunit-paratest.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<testsuite name="main">
2727
<directory>tests</directory>
2828
<exclude>tests/Integration/ResetDatabase</exclude>
29+
<exclude>tests/Unit/Test/Behat</exclude>
30+
<exclude>tests/Unit/Integration/Behat</exclude>
2931
</testsuite>
3032
</testsuites>
3133
<source ignoreSuppressionOfDeprecations="true" baseline="phpunit-deprecation-baseline.xml">

src/Test/Behat/FoundryTableNode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function create(
5353
return $tableNode;
5454
}
5555

56-
public function getRowAsString(int $rowNum): string
56+
public function getRowAsString($rowNum): string
5757
{
5858
$values = [];
5959
foreach ($this->getRow($rowNum) as $column => $value) {
@@ -63,7 +63,7 @@ public function getRowAsString(int $rowNum): string
6363
return sprintf('|%s|', implode('|', $values));
6464
}
6565

66-
public function getRowAsStringWithWrappedValues(int $rowNum, callable $wrapper): string
66+
public function getRowAsStringWithWrappedValues($rowNum, $wrapper): string
6767
{
6868
$values = [];
6969
foreach ($this->getRow($rowNum) as $column => $value) {

tests/Integration/Behat/Listener/BootConfigurationListenerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Zenstruck\Foundry\Tests\Integration\Behat\Listener;
1515

16+
use PHPUnit\Framework\Attributes\RequiresPhp;
1617
use PHPUnit\Framework\Attributes\Test;
1718
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1819
use Zenstruck\Foundry\Configuration;
@@ -24,6 +25,7 @@
2425
use Zenstruck\Foundry\Tests\Fixture\Factories\Entity\GenericEntityFactory;
2526
use Zenstruck\Foundry\Tests\Integration\RequiresORM;
2627

28+
#[RequiresPhp('9')]
2729
final class BootConfigurationListenerTest extends KernelTestCase
2830
{
2931
use Factories, RequiresORM, ResetDatabase;

tests/Integration/Behat/Listener/DatabaseResetListenerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Behat\Testwork\Environment\StaticEnvironment;
2121
use Behat\Testwork\Suite\GenericSuite;
2222
use PHPUnit\Framework\Attributes\DataProvider;
23+
use PHPUnit\Framework\Attributes\RequiresPhp;
2324
use PHPUnit\Framework\Attributes\Test;
2425
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2526
use Zenstruck\Foundry\Test\Behat\DatabaseResetMode;
@@ -33,6 +34,7 @@
3334
use Zenstruck\Foundry\Tests\Fixture\Factories\Entity\GenericEntityFactory;
3435
use Zenstruck\Foundry\Tests\Integration\RequiresORM;
3536

37+
#[RequiresPhp('9')]
3638
final class DatabaseResetListenerTest extends KernelTestCase
3739
{
3840
use Factories, RequiresORM, ResetDatabase;

0 commit comments

Comments
 (0)