Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class DocBlockResolverAwareTest extends TestCase |
||
12 | { |
||
13 | public static function setUpBeforeClass(): void |
||
14 | { |
||
15 | CustomServicesCache::resetCache(); |
||
16 | } |
||
17 | |||
18 | protected function setUp(): void |
||
19 | { |
||
20 | Gacela::bootstrap(__DIR__); |
||
21 | } |
||
22 | |||
23 | public function test_existing_service(): void |
||
24 | { |
||
25 | $dummy = new DummyDocBlockResolverAware(); |
||
26 | $actual = $dummy->getRepository()->findName(); |
||
27 | |||
28 | self::assertSame('name', $actual); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @depends test_existing_service |
||
33 | */ |
||
34 | public function test_existing_service_cached(): void |
||
35 | { |
||
36 | self::assertCount(1, CustomServicesCache::getAll()); |
||
37 | |||
38 | $dummy = new DummyDocBlockResolverAware(); |
||
39 | $dummy->getRepository()->findName(); |
||
40 | $dummy->getRepository()->findName(); |
||
41 | |||
42 | self::assertCount(1, CustomServicesCache::getAll()); |
||
43 | } |
||
44 | |||
45 | public function test_non_existing_service(): void |
||
51 | } |
||
52 | } |
||
53 |