Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function testInvokeWillCreateACommentControllerInstance() |
||
17 | { |
||
18 | $containerMock = $this->createMock(ContainerInterface::class); |
||
19 | |||
20 | $configServiceMock = [uniqid()]; |
||
21 | $commentTableMock = $this->createMock(CommentTable::class); |
||
22 | $akismetServiceMock = $this->createMock(Akismet::class); |
||
23 | |||
24 | $commentControllerFactory = new CommentControllerFactory(); |
||
25 | |||
26 | // Expectations |
||
27 | $containerMock->expects($this->exactly(3)) |
||
28 | ->method('get') |
||
29 | ->withConsecutive( |
||
30 | ['Config'], |
||
31 | [CommentTable::class], |
||
32 | ['RbComment\Akismet'] |
||
33 | ) |
||
34 | ->willReturnOnConsecutiveCalls( |
||
35 | $configServiceMock, |
||
36 | $commentTableMock, |
||
37 | $akismetServiceMock |
||
38 | ); |
||
39 | |||
40 | $controller = $commentControllerFactory($containerMock, CommentController::class); |
||
41 | |||
42 | // Assertions |
||
43 | $this->assertInstanceOf(CommentController::class, $controller); |
||
44 | } |
||
45 | } |
||
46 |