Skip to content

Commit 42f1f42

Browse files
committed
Add unit test for API
1 parent c520754 commit 42f1f42

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/Github/Tests/Api/UserTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,29 @@ public function shouldGetUserGists()
228228
$this->assertEquals($expectedArray, $api->gists('l3l0'));
229229
}
230230

231+
/**
232+
* @test
233+
*/
234+
public function shouldGetAuthorizedUserEvents()
235+
{
236+
$expectedArray = [
237+
[
238+
'id' => 1,
239+
'actor' => [
240+
'id' => 1,
241+
'login' => 'l3l0',
242+
],
243+
],
244+
];
245+
$api = $this->getApiMock();
246+
$api->expects($this->once())
247+
->method('get')
248+
->with('/users/l3l0/events')
249+
->will($this->returnValue($expectedArray));
250+
251+
$this->assertEquals($expectedArray, $api->events('l3l0'));
252+
}
253+
231254
/**
232255
* @return string
233256
*/

0 commit comments

Comments
 (0)