| @@ 55-63 (lines=9) @@ | ||
| 52 | $this->assertEquals($loader, current($loaders)); |
|
| 53 | } |
|
| 54 | ||
| 55 | public function testHasLoaderPassed() |
|
| 56 | { |
|
| 57 | $loader = $this->prophesize(LoaderInterface::class)->reveal(); |
|
| 58 | ||
| 59 | $collection = new LoaderCollection(); |
|
| 60 | $collection->add('test', $loader); |
|
| 61 | ||
| 62 | $this->assertTrue($collection->has('test')); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testHasLoaderFailed() |
|
| 66 | { |
|
| @@ 65-73 (lines=9) @@ | ||
| 62 | $this->assertTrue($collection->has('test')); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testHasLoaderFailed() |
|
| 66 | { |
|
| 67 | $loader = $this->prophesize(LoaderInterface::class)->reveal(); |
|
| 68 | ||
| 69 | $collection = new LoaderCollection(); |
|
| 70 | $collection->add('test', $loader); |
|
| 71 | ||
| 72 | $this->assertFalse($collection->has('toto')); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testGetLoaderPassed() |
|
| 76 | { |
|
| @@ 75-83 (lines=9) @@ | ||
| 72 | $this->assertFalse($collection->has('toto')); |
|
| 73 | } |
|
| 74 | ||
| 75 | public function testGetLoaderPassed() |
|
| 76 | { |
|
| 77 | $loader = $this->prophesize(LoaderInterface::class)->reveal(); |
|
| 78 | ||
| 79 | $collection = new LoaderCollection(); |
|
| 80 | $collection->add('test', $loader); |
|
| 81 | ||
| 82 | $this->assertEquals($loader, $collection->get('test')); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testGetLoaderFailed() |
|
| 86 | { |
|
| @@ 85-95 (lines=11) @@ | ||
| 82 | $this->assertEquals($loader, $collection->get('test')); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testGetLoaderFailed() |
|
| 86 | { |
|
| 87 | $loader = $this->prophesize(LoaderInterface::class)->reveal(); |
|
| 88 | ||
| 89 | $collection = new LoaderCollection(); |
|
| 90 | $collection->add('test', $loader); |
|
| 91 | ||
| 92 | $this->expectException(\RuntimeException::class); |
|
| 93 | ||
| 94 | $collection->get('toto'); |
|
| 95 | } |
|
| 96 | } |
|