Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class CacheFactoryTest extends TestCase |
||
16 | { |
||
17 | /** @var CacheFactory */ |
||
18 | private $factory; |
||
19 | /** @var ServiceManager */ |
||
20 | private $sm; |
||
21 | |||
22 | public function setUp(): void |
||
23 | { |
||
24 | $this->factory = new CacheFactory(); |
||
25 | $this->sm = new ServiceManager(['services' => [ |
||
26 | AppOptions::class => new AppOptions(), |
||
27 | ]]); |
||
28 | } |
||
29 | |||
30 | public static function tearDownAfterClass(): void |
||
33 | } |
||
34 | |||
35 | /** @test */ |
||
36 | public function productionReturnsApcAdapter(): void |
||
37 | { |
||
38 | putenv('APP_ENV=pro'); |
||
39 | $instance = ($this->factory)($this->sm, ''); |
||
40 | $this->assertInstanceOf(ApcuCache::class, $instance); |
||
41 | } |
||
42 | |||
43 | /** @test */ |
||
44 | public function developmentReturnsArrayAdapter(): void |
||
49 | } |
||
50 | } |
||
51 |