| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function testaddWorkLogEntry(): void |
||
| 18 | { |
||
| 19 | $endPoint = 'http://www.example.com'; |
||
| 20 | |||
| 21 | $authenticationMock = \Mockery::mock(AuthenticationInterface::class); |
||
|
1 ignored issue
–
show
|
|||
| 22 | $clientMock = \Mockery::mock(ClientInterface::class); |
||
| 23 | $clientMock->shouldReceive('sendRequest') |
||
|
1 ignored issue
–
show
|
|||
| 24 | ->with( |
||
| 25 | Api::REQUEST_POST, |
||
|
1 ignored issue
–
show
|
|||
| 26 | "/rest/api/2/issue/DVA-42/worklog?adjustEstimate=auto", |
||
| 27 | [ |
||
| 28 | 'author' => [ |
||
| 29 | 'accountId' => 'D-Va', |
||
| 30 | ], |
||
| 31 | 'created' => '2017-04-15T23:35:00+02:00', |
||
| 32 | 'timeSpentSeconds' => 9001, |
||
| 33 | 'comment' => 'Nerf this!' |
||
| 34 | ], |
||
| 35 | 'http://www.example.com', |
||
| 36 | $authenticationMock, |
||
|
1 ignored issue
–
show
|
|||
| 37 | false, |
||
|
1 ignored issue
–
show
|
|||
| 38 | false |
||
| 39 | ) |
||
| 40 | ->andReturn('{}'); |
||
|
2 ignored issues
–
show
|
|||
| 41 | |||
| 42 | $api = new Api($endPoint, $authenticationMock, $clientMock); |
||
|
2 ignored issues
–
show
|
|||
| 43 | |||
| 44 | $result = $api->addWorkLogEntry( |
||
| 45 | 'DVA-42', |
||
| 46 | 9001, |
||
| 47 | 'D-Va', |
||
| 48 | 'Nerf this!', |
||
| 49 | '2017-04-15T23:35:00+02:00' |
||
| 50 | ); |
||
| 51 | |||
| 52 | $this->assertInstanceOf(Result::class, $result); |
||
| 53 | } |
||
| 54 | } |