Skip to content

Commit 89ce45d

Browse files
oliverkleeSam Tuke
authored andcommitted
[BUGFIX] Use the new core Environment class and methods (#33)
1 parent 127ff86 commit 89ce45d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

Tests/Integration/Controller/AbstractControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use Doctrine\ORM\EntityManagerInterface;
77
use PhpList\PhpList4\Core\Bootstrap;
8+
use PhpList\PhpList4\Core\Environment;
89
use PHPUnit\DbUnit\Database\Connection;
910
use PHPUnit\DbUnit\DataSet\CsvDataSet;
1011
use PHPUnit\DbUnit\TestCaseTrait;
@@ -49,8 +50,7 @@ abstract class AbstractControllerTest extends WebTestCase
4950
protected function setUp()
5051
{
5152
$this->initializeDatabaseTester();
52-
$this->bootstrap = Bootstrap::getInstance()->setApplicationContext(Bootstrap::APPLICATION_CONTEXT_TESTING)
53-
->configure();
53+
$this->bootstrap = Bootstrap::getInstance()->setEnvironment(Environment::TESTING)->configure();
5454
$this->entityManager = $this->bootstrap->getEntityManager();
5555
self::assertTrue($this->entityManager->isOpen());
5656
}

Tests/Integration/Controller/SessionControllerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use Doctrine\Common\Persistence\ObjectRepository;
77
use PhpList\PhpList4\Core\Bootstrap;
8+
use PhpList\PhpList4\Core\Environment;
89
use PhpList\PhpList4\Domain\Model\Identity\AdministratorToken;
910
use PhpList\PhpList4\Domain\Repository\Identity\AdministratorTokenRepository;
1011
use Symfony\Bundle\FrameworkBundle\Client;
@@ -36,9 +37,9 @@ protected function setUp()
3637
{
3738
parent::setUp();
3839

39-
Bootstrap::getInstance()->setApplicationContext(Bootstrap::APPLICATION_CONTEXT_TESTING)->configure();
40+
$this->bootstrap = Bootstrap::getInstance()->setEnvironment(Environment::TESTING)->configure();
4041

41-
$this->client = self::createClient(['environment' => Bootstrap::APPLICATION_CONTEXT_TESTING]);
42+
$this->client = self::createClient(['environment' => Environment::TESTING]);
4243

4344
$this->administratorTokenRepository = $this->entityManager->getRepository(AdministratorToken::class);
4445
}

0 commit comments

Comments
 (0)