Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | public function testInvoke(): void |
||
19 | { |
||
20 | $syncOptionMock = \Mockery::mock(SyncOptions::class); |
||
21 | $syncOptionMock->shouldReceive('getJiraUrl')->andReturn('http://www.example.com'); |
||
22 | $syncOptionMock->shouldReceive('getJiraUsername')->andReturn('foo'); |
||
23 | $syncOptionMock->shouldReceive('getJiraLoginUsername')->andReturn('[email protected]'); |
||
24 | $syncOptionMock->shouldReceive('getJiraPassword')->andReturn('bar'); |
||
25 | $syncOptionMock->shouldReceive('getTogglApiKey')->andReturn('baz'); |
||
26 | $syncOptionMock->shouldReceive('getFillIssueID')->andReturn('FOO-01'); |
||
27 | $syncOptionMock->shouldReceive('isNotifyUsers')->andReturn(true); |
||
28 | |||
29 | $loggerMock = \Mockery::mock(LoggerInterface::class); |
||
30 | |||
31 | $this->getContainer() |
||
32 | ->shouldReceive('get') |
||
33 | ->withArgs([SyncOptions::class]) |
||
34 | ->andReturn($syncOptionMock); |
||
35 | |||
36 | $this->getContainer() |
||
37 | ->shouldReceive('get') |
||
38 | ->withArgs(['Logger']) |
||
39 | ->andReturn($loggerMock); |
||
40 | |||
41 | $factory = new SyncServiceFactory(); |
||
42 | $instance = $factory->__invoke($this->getContainer(), SyncService::class); |
||
43 | |||
44 | $this->assertInstanceOf(SyncService::class, $instance); |
||
45 | } |
||
47 |