| 1 | <?php |
||
| 19 | class EnvironmentFactoryTest extends TestCase |
||
| 20 | { |
||
| 21 | |||
| 22 | private $factory; |
||
| 23 | |||
| 24 | protected function setUp() |
||
| 25 | { |
||
| 26 | $this->factory = new EnvironmentFactory(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function testCreateService() |
||
| 30 | { |
||
| 31 | $container = $this->prophesize(ContainerInterface::class); |
||
| 32 | |||
| 33 | $imageRenderer = $this->prophesize(ImageRenderer::class); |
||
| 34 | $container |
||
| 35 | ->get(ImageRenderer::class) |
||
| 36 | ->willReturn($imageRenderer->reveal()); |
||
| 37 | |||
| 38 | $environment = $this->factory->__invoke($container->reveal()); |
||
| 39 | $this->assertInstanceOf(Environment::class, $environment); |
||
| 40 | $this->assertInstanceOf(ImageRenderer::class, $environment->getInlineRendererForClass(Image::class)); |
||
| 41 | } |
||
| 42 | } |