Skip to content

Commit

Permalink
Share bootstrap between behat & phpunit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luispabon committed Jul 26, 2021
1 parent bf8f38a commit 9508b69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default:

extensions:
FriendsOfBehat\SymfonyExtension:
bootstrap: 'config/behat_bootstrap.php'
bootstrap: 'tests/bootstrap.php'
Behat\MinkExtension:
show_cmd: 'firefox %s'
sessions:
Expand Down
20 changes: 0 additions & 20 deletions config/behat_bootstrap.php

This file was deleted.

9 changes: 6 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php
/**
* Test environment (behat & phpunit).
*
* Loads .env support.
*/
declare(strict_types=1);

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__) . '/vendor/autoload.php';

if (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
}
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');

0 comments on commit 9508b69

Please sign in to comment.