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