-
-
Notifications
You must be signed in to change notification settings - Fork 498
Closed
Description
On a vanilla install of Symfony 4.2, running PHPUnit fails with the error Undefined index: APP_ENV
. I traced the issue down to the use of elvis operators instead of null coalesce operators (used on the next line) in config/bootstrap.php.
I was able to resolve by changing
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?: $_ENV['APP_ENV'] ?: 'dev';
to
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
in config/bootstrap.php.
Steps to reproduce (tested with CentOS 7, PHP 7.2.13, Symfony CLI 4.2.2)
$ symfony new --full test
$ cd test
$ bin/phpunit
verdet-a, ro0NL, revok and petrofcikmatus
Metadata
Metadata
Assignees
Labels
No labels