| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function testLoad() |
||
| 25 | { |
||
| 26 | // TwigExtensionPluginInterface |
||
| 27 | $loader = new ExtensionLoader(); |
||
| 28 | $env = $this->createMock(Environment::class); |
||
| 29 | |||
| 30 | $objectInvalid = new \stdClass(); |
||
| 31 | |||
| 32 | $loader->load($env, $objectInvalid); |
||
| 33 | |||
| 34 | $extension = $this->createMock(ExtensionInterface::class); |
||
| 35 | $objectValid = $this->createMock(TwigExtensionPluginInterface::class); |
||
| 36 | |||
| 37 | $env |
||
| 38 | ->expects($this->once()) |
||
| 39 | ->method('addExtension') |
||
| 40 | ->with($extension); |
||
| 41 | |||
| 42 | $objectValid |
||
| 43 | ->expects($this->once()) |
||
| 44 | ->method('provideTwigExtensions') |
||
| 45 | ->willReturn(new \ArrayObject( |
||
| 46 | [$extension] |
||
| 47 | )); |
||
| 48 | |||
| 49 | $loader->load($env, $objectValid); |
||
| 50 | } |
||
| 52 |