Skip to content

Commit 821b256

Browse files
committed
Fix --prefer-lowest tests
1 parent 43bddc1 commit 821b256

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ Coverage will be available in `coverage/index.html`.
9797

9898
The command to launch Behat tests is:
9999

100-
./vendor/bin/behat --suite=default --stop-on-failure -vvv
100+
php -d memory_limit=-1 ./vendor/bin/behat --suite=default --stop-on-failure --format=progress
101101

102102
If you want to launch Behat tests for MongoDB, the command is:
103103

104-
APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
104+
APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --suite=mongodb --stop-on-failure --format=progress
105+
106+
To get more details about an error, replace `--format=progress` by `-vvv`.
105107

106108
## Squash your Commits
107109

tests/Fixtures/app/AppKernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use ApiPlatform\Core\Tests\Fixtures\TestBundle\TestBundle;
1818
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
1919
use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
20+
use Doctrine\Common\Inflector\Inflector;
21+
use Doctrine\Inflector\InflectorFactory;
2022
use FOS\UserBundle\FOSUserBundle;
2123
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
2224
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
@@ -48,6 +50,12 @@ public function __construct(string $environment, bool $debug)
4850

4951
// patch for behat/symfony2-extension not supporting %env(APP_ENV)%
5052
$this->environment = $_SERVER['APP_ENV'] ?? $environment;
53+
54+
// patch for old versions of Doctrine Inflector, to delete when we'll drop support for v1
55+
// see https://github.com/doctrine/inflector/issues/147#issuecomment-628807276
56+
if (!class_exists(InflectorFactory::class)) {
57+
Inflector::rules('plural', ['/taxon/i' => 'taxa']);
58+
}
5159
}
5260

5361
public function registerBundles(): array

0 commit comments

Comments
 (0)