@@ -363,9 +363,14 @@ public function testGetContributorsDecodesResponseToArray()
363363
364364 array_walk ($ contributors , function ($ contributor ) {
365365 $ this ->assertInternalType ('array ' , $ contributor );
366- $ this ->assertArrayHasKey ('login ' , $ contributor );
367- $ this ->assertArrayHasKey ('avatar_url ' , $ contributor );
368- $ this ->assertArrayHasKey ('html_url ' , $ contributor );
366+ $ this ->assertArrayHasKey ('author ' , $ contributor );
367+
368+ $ author = $ contributor ['author ' ];
369+
370+ $ this ->assertInternalType ('array ' , $ author );
371+ $ this ->assertArrayHasKey ('login ' , $ author );
372+ $ this ->assertArrayHasKey ('avatar_url ' , $ author );
373+ $ this ->assertArrayHasKey ('html_url ' , $ author );
369374 });
370375 }
371376
@@ -417,18 +422,23 @@ public function testGetContributorsReturnsContributorsInReverseOrder()
417422
418423 array_walk ($ contributors , function ($ contributor ) use (&$ contributorsAsReturned ) {
419424
420- $ expectedContributor = array_pop ($ contributorsAsReturned );
425+ $ expected = array_pop ($ contributorsAsReturned );
421426
422427 $ this ->assertInternalType ('array ' , $ contributor );
428+ $ this ->assertArrayHasKey ('author ' , $ contributor );
429+
430+ $ author = $ contributor ['author ' ];
423431
424- $ this ->assertArrayHasKey ('login ' , $ contributor );
425- $ this ->assertSame ($ expectedContributor ->login , $ contributor ['login ' ]);
432+ $ this ->assertInternalType ('array ' , $ author );
426433
427- $ this ->assertArrayHasKey ('avatar_url ' , $ contributor );
428- $ this ->assertSame ($ expectedContributor -> avatar_url , $ contributor [ ' avatar_url ' ]);
434+ $ this ->assertArrayHasKey ('login ' , $ author );
435+ $ this ->assertSame ($ expected -> author -> login , $ author [ ' login ' ]);
429436
430- $ this ->assertArrayHasKey ('html_url ' , $ contributor );
431- $ this ->assertSame ($ expectedContributor ->html_url , $ contributor ['html_url ' ]);
437+ $ this ->assertArrayHasKey ('avatar_url ' , $ author );
438+ $ this ->assertSame ($ expected ->author ->avatar_url , $ author ['avatar_url ' ]);
439+
440+ $ this ->assertArrayHasKey ('html_url ' , $ author );
441+ $ this ->assertSame ($ expected ->author ->html_url , $ author ['html_url ' ]);
432442 });
433443 }
434444
@@ -471,17 +481,21 @@ public function testGetContributorsReturnsFalseIfRuntimeExceptionIsThrown()
471481 }
472482
473483 /**
474- * @link https://developer.github.com/v3/repos/#response-5
484+ * @link https://developer.github.com/v3/repos/statistics/ #response
475485 *
476486 * @return stdClass
477487 */
478488 private function contributor ()
479489 {
490+ $ author = new stdClass ();
491+
492+ $ author ->login = $ this ->faker ()->unique ()->userName ;
493+ $ author ->avatar_url = $ this ->faker ()->unique ()->url ;
494+ $ author ->html_url = $ this ->faker ()->unique ()->url ;
495+
480496 $ contributor = new stdClass ();
481497
482- $ contributor ->login = $ this ->faker ()->unique ()->userName ;
483- $ contributor ->avatar_url = $ this ->faker ()->unique ()->url ;
484- $ contributor ->html_url = $ this ->faker ()->unique ()->url ;
498+ $ contributor ->author = $ author ;
485499
486500 return $ contributor ;
487501 }
0 commit comments