Total Complexity | 7 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
12 | class FunctionalTest extends TestCase |
||
13 | { |
||
14 | use HttpRequestCapabilities; |
||
15 | use JsonAssertions; |
||
16 | use Psr7Assertions; |
||
17 | |||
18 | const CONFIG_DIRECTORY_PATH = __DIR__ . '/../../../config'; |
||
19 | |||
20 | protected $reloadDb = true; |
||
21 | |||
22 | /** @var Container */ |
||
23 | private static $container; |
||
24 | |||
25 | protected function setUp() |
||
26 | { |
||
27 | if ($this->reloadDb) { |
||
28 | $loader = $this->getContainer()->get(FixtureLoader::class); |
||
29 | $loader->load(); |
||
30 | } |
||
31 | |||
32 | parent::setUp(); |
||
33 | } |
||
34 | |||
35 | protected function tearDown() |
||
36 | { |
||
37 | m::close(); |
||
38 | |||
39 | $this->reloadDb = true; |
||
40 | |||
41 | parent::tearDown(); |
||
42 | } |
||
43 | |||
44 | public function getFromContainer(string $id) |
||
47 | } |
||
48 | |||
49 | public function getContainer(): Container |
||
50 | { |
||
51 | if (!isset(self::$container)) { |
||
52 | Bootstrap::init(self::CONFIG_DIRECTORY_PATH); |
||
53 | self::$container = Bootstrap::getContainer(); |
||
54 | } |
||
55 | |||
56 | return self::$container; |
||
57 | } |
||
58 | |||
59 | public function setInContainer($name, $value): void |
||
62 | } |
||
63 | } |
||
64 |