Skip to content

Commit 5703492

Browse files
committed
Add unit test
1 parent 5ed46cc commit 5703492

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Github/Tests/Api/UserTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ public function shouldShowUser()
2020
$this->assertEquals($expectedArray, $api->show('l3l0'));
2121
}
2222

23+
/**
24+
* @test
25+
*/
26+
public function shouldShowByIdUser()
27+
{
28+
$expectedArray = ['id' => 1, 'username' => 'l3l0'];
29+
30+
$api = $this->getApiMock();
31+
$api->expects($this->once())
32+
->method('get')
33+
->with('/user/1')
34+
->will($this->returnValue($expectedArray));
35+
36+
$this->assertEquals($expectedArray, $api->showById(1));
37+
}
38+
2339
/**
2440
* @test
2541
*/

0 commit comments

Comments
 (0)