| @@ 18-34 (lines=17) @@ | ||
| 15 | /** |
|
| 16 | * @test |
|
| 17 | */ |
|
| 18 | public function itCreatesKernelOnInvoke() |
|
| 19 | { |
|
| 20 | $serviceLocator = $this->prophesize(ServiceLocatorInterface::class); |
|
| 21 | $serviceLocator->get('config') |
|
| 22 | ->willReturn(['goaop_module' => require __DIR__ . '/../../resources/goaop_module.php']) |
|
| 23 | ->shouldBeCalled(); |
|
| 24 | ||
| 25 | $factory = new AspectKernelFactory(); |
|
| 26 | ||
| 27 | $instance = $factory($serviceLocator->reveal(), AspectKernel::class); |
|
| 28 | ||
| 29 | $this->assertInstanceOf( |
|
| 30 | AspectKernel::class, |
|
| 31 | $instance, |
|
| 32 | 'factory should return an instance of ' . AspectKernel::class |
|
| 33 | ); |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @test |
|
| @@ 39-55 (lines=17) @@ | ||
| 36 | /** |
|
| 37 | * @test |
|
| 38 | */ |
|
| 39 | public function itCreatesKernelOnCreateService() |
|
| 40 | { |
|
| 41 | $serviceLocator = $this->prophesize(ServiceLocatorInterface::class); |
|
| 42 | $serviceLocator->get('config') |
|
| 43 | ->willReturn(['goaop_module' => require __DIR__ . '/../../resources/goaop_module.php']) |
|
| 44 | ->shouldBeCalled(); |
|
| 45 | ||
| 46 | $factory = new AspectKernelFactory(); |
|
| 47 | ||
| 48 | $instance = $factory->createService($serviceLocator->reveal()); |
|
| 49 | ||
| 50 | $this->assertInstanceOf( |
|
| 51 | AspectKernel::class, |
|
| 52 | $instance, |
|
| 53 | 'factory should return an instance of ' . AspectKernel::class |
|
| 54 | ); |
|
| 55 | } |
|
| 56 | } |
|