symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.91k stars 213 forks source link

cannot get PANTHER_APP_ENV to work #542

Closed arderyp closed 2 years ago

arderyp commented 2 years ago

This env var works (it launches a visible browser instead of running headless):

PANTHER_NO_HEADLESS=1 ./bin/simple-phpunit tests/MyPantherTest.php

This, however, doesn't seem to work:

PANTHER_APP_ENV=panther ./bin/simple-phpunit tests/MyPantherTest.php

When I dump the environment variable that gets set in Kernel.php, it still shows "test":

// from my Kernel.php
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
    echo "\n\nFROM KERNEL: APP_ENV = $this->environment\n\n";
     ...
}

There is no change in this behavior if is declare PANTHER_APP_ENV=panther before my test command, or when I add it to my phpunit.xml file. Am I missing something?