Skip to content

Commit

Permalink
Fix --prefer-lowest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed May 28, 2020
1 parent 43bddc1 commit 821b256
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -97,11 +97,13 @@ Coverage will be available in `coverage/index.html`.

The command to launch Behat tests is:

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

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

APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
APP_ENV=mongodb php -d memory_limit=-1 ./vendor/bin/behat --suite=mongodb --stop-on-failure --format=progress

To get more details about an error, replace `--format=progress` by `-vvv`.

## Squash your Commits

Expand Down
8 changes: 8 additions & 0 deletions tests/Fixtures/app/AppKernel.php
Expand Up @@ -17,6 +17,8 @@
use ApiPlatform\Core\Tests\Fixtures\TestBundle\TestBundle;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\Inflector\InflectorFactory;
use FOS\UserBundle\FOSUserBundle;
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
Expand Down Expand Up @@ -48,6 +50,12 @@ public function __construct(string $environment, bool $debug)

// patch for behat/symfony2-extension not supporting %env(APP_ENV)%
$this->environment = $_SERVER['APP_ENV'] ?? $environment;

// patch for old versions of Doctrine Inflector, to delete when we'll drop support for v1
// see https://github.com/doctrine/inflector/issues/147#issuecomment-628807276
if (!class_exists(InflectorFactory::class)) {
Inflector::rules('plural', ['/taxon/i' => 'taxa']);
}
}

public function registerBundles(): array
Expand Down

0 comments on commit 821b256

Please sign in to comment.