@@ 22-37 (lines=16) @@ | ||
19 | $this->assertTrue($reflection->isPrivate()); |
|
20 | } |
|
21 | ||
22 | public function testAddKey() |
|
23 | { |
|
24 | $loader = $this->createMock(LoaderInterface::class); |
|
25 | $alias = 'test'; |
|
26 | ||
27 | $collection = new LoaderCollection(); |
|
28 | $collection->add($alias, $loader); |
|
29 | ||
30 | $reflection = new \ReflectionProperty(LoaderCollection::class, 'loaders'); |
|
31 | $reflection->setAccessible(true); |
|
32 | $loaders = $reflection->getValue($collection); |
|
33 | ||
34 | reset($loaders); |
|
35 | ||
36 | $this->assertEquals($alias, key($loaders)); |
|
37 | } |
|
38 | ||
39 | public function testAddValue() |
|
40 | { |
|
@@ 39-54 (lines=16) @@ | ||
36 | $this->assertEquals($alias, key($loaders)); |
|
37 | } |
|
38 | ||
39 | public function testAddValue() |
|
40 | { |
|
41 | $loader = $this->createMock(LoaderInterface::class); |
|
42 | $alias = 'test'; |
|
43 | ||
44 | $collection = new LoaderCollection(); |
|
45 | $collection->add($alias, $loader); |
|
46 | ||
47 | $reflection = new \ReflectionProperty(LoaderCollection::class, 'loaders'); |
|
48 | $reflection->setAccessible(true); |
|
49 | $loaders = $reflection->getValue($collection); |
|
50 | ||
51 | reset($loaders); |
|
52 | ||
53 | $this->assertEquals($loader, current($loaders)); |
|
54 | } |
|
55 | ||
56 | public function testHas() |
|
57 | { |