@@ -394,6 +394,59 @@ public function shouldDismissReview()
394
394
$ this ->assertSame ($ expectedValue , $ api ->dismiss ('octocat ' , 'Hello-World ' , 12 , 80 , 'Dismiss reason ' ));
395
395
}
396
396
397
+ /**
398
+ * @test
399
+ */
400
+ public function shouldUpdateReviewComment ()
401
+ {
402
+ $ expectedValue = [
403
+ 'id ' => 80 ,
404
+ 'node_id ' => 'MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA= ' ,
405
+ 'user ' => [
406
+ 'login ' => 'octocat ' ,
407
+ 'id ' => 1 ,
408
+ 'avatar_url ' => 'https://github.com/images/error/octocat_happy.gif ' ,
409
+ 'gravatar_id ' => '' ,
410
+ 'url ' => 'https://api.github.com/users/octocat ' ,
411
+ 'html_url ' => 'https://github.com/octocat ' ,
412
+ 'followers_url ' => 'https://api.github.com/users/octocat/followers ' ,
413
+ 'following_url ' => 'https://api.github.com/users/octocat/following{/other_user} ' ,
414
+ 'gists_url ' => 'https://api.github.com/users/octocat/gists{/gist_id} ' ,
415
+ 'starred_url ' => 'https://api.github.com/users/octocat/starred{/owner}{/repo} ' ,
416
+ 'subscriptions_url ' => 'https://api.github.com/users/octocat/subscriptions ' ,
417
+ 'organizations_url ' => 'https://api.github.com/users/octocat/orgs ' ,
418
+ 'repos_url ' => 'https://api.github.com/users/octocat/repos ' ,
419
+ 'events_url ' => 'https://api.github.com/users/octocat/events{/privacy} ' ,
420
+ 'received_events_url ' => 'https://api.github.com/users/octocat/received_events ' ,
421
+ 'type ' => 'User ' ,
422
+ 'site_admin ' => false ,
423
+ ],
424
+ 'body ' => 'Great stuff ' ,
425
+ 'commit_id ' => 'ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091 ' ,
426
+ 'state ' => 'CHANGES_REQUESTED ' ,
427
+ 'html_url ' => 'https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80 ' ,
428
+ 'pull_request_url ' => 'https://api.github.com/repos/octocat/Hello-World/pulls/12 ' ,
429
+ '_links ' => [
430
+ 'html ' => [
431
+ 'href ' => 'https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80 ' ,
432
+ ],
433
+ 'pull_request ' => [
434
+ 'href ' => 'https://api.github.com/repos/octocat/Hello-World/pulls/12 ' ,
435
+ ],
436
+ ],
437
+ ];
438
+ $ body = 'Nice change ' ;
439
+
440
+ $ api = $ this ->getApiMock ();
441
+ $ api
442
+ ->expects ($ this ->once ())
443
+ ->method ('put ' )
444
+ ->with ('/repos/octocat/Hello-World/pulls/12/reviews/80 ' )
445
+ ->willReturn ($ expectedValue );
446
+
447
+ $ this ->assertSame ($ expectedValue , $ api ->update ('octocat ' , 'Hello-World ' , 12 , 80 , $ body ));
448
+ }
449
+
397
450
protected function getApiClass ()
398
451
{
399
452
return Review::class;
0 commit comments