File tree Expand file tree Collapse file tree 5 files changed +11
-12
lines changed
MappingTest/RelationTests Expand file tree Collapse file tree 5 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 77use Takuya \BacklogApiClient \Models \Traits \HasIssueId ;
88use Takuya \BacklogApiClient \Models \User ;
99use Takuya \BacklogApiClient \Models \Star ;
10- use Takuya \BacklogApiClient \Models \CommentNotification ;
10+ use Takuya \BacklogApiClient \Models \Notification ;
1111class Comment extends BaseModel {
1212
1313 use HasID;
@@ -21,6 +21,6 @@ class Comment extends BaseModel {
2121 public string $ updated ;
2222 /** @var array | Star[] */
2323 public array $ stars ;
24- /** @var array | CommentNotification [] */
24+ /** @var array | Notification [] */
2525 public array $ notifications ;
2626}
Original file line number Diff line number Diff line change 1414 * @property-read object $user
1515 * @property-read bool $resourceAlreadyRead
1616 */
17- class CommentNotification extends BaseModel {
17+ class Notification extends BaseModel {
1818
1919 /**
2020 * 連番に欠番あり。
Original file line number Diff line number Diff line change 88use Takuya \BacklogApiClient \Models \NulabAccount ;
99use Takuya \BacklogApiClient \Models \IssueAttachment ;
1010use Takuya \BacklogApiClient \Models \SharedFile ;
11- use Takuya \BacklogApiClient \Models \CommentNotification ;
11+ use Takuya \BacklogApiClient \Models \Notification ;
1212use Takuya \BacklogApiClient \Models \BaseModel ;
1313
1414trait ApiToModelMapping {
@@ -61,7 +61,7 @@ public static function attribute_mapping_list(): array {
6161 ['nulabAccount ' , NulabAccount::class],
6262 ['attachments ' , IssueAttachment::class],
6363 ['sharedFiles ' , SharedFile::class],
64- ['notifications ' , CommentNotification ::class],
64+ ['notifications ' , Notification ::class],
6565 ];
6666 return $ mapping ;
6767 }
Original file line number Diff line number Diff line change 77use Takuya \BacklogApiClient \Models \Issue ;
88use Takuya \BacklogApiClient \Models \Comment ;
99use Takuya \BacklogApiClient \Models \SharedFile ;
10- use Takuya \BacklogApiClient \Models \CommentNotification ;
10+ use Takuya \BacklogApiClient \Models \Notification ;
1111use Takuya \BacklogApiClient \Models \IssueAttachment ;
1212
1313class BacklogIssueModelTest extends TestCaseBacklogModels {
@@ -61,11 +61,11 @@ public function test_get_notification_of_issue_comment () {
6161 if ( sizeof ( $ comment ->notifications ) == 0 ) {
6262 continue ;
6363 }
64- /** @var CommentNotification $notification */
64+ /** @var Notification $notification */
6565 foreach ( $ comment ->notifications as $ notification ) {
66- $ this ->assertEquals ( CommentNotification ::class, get_class ( $ notification ) );
66+ $ this ->assertEquals ( Notification ::class, get_class ( $ notification ) );
6767 $ this ->assertEquals ( User::class, get_class ( $ notification ->user ) );
68- $ this ->assertContains ( $ notification ->reason , CommentNotification ::REASON );
68+ $ this ->assertContains ( $ notification ->reason , Notification ::REASON );
6969 }
7070 break 3 ;
7171 }
Original file line number Diff line number Diff line change 66use Takuya \BacklogApiClient \Models \Issue ;
77use tests \Unit \Model \TestCaseBacklogModels ;
88use Takuya \BacklogApiClient \Models \Comment ;
9- use Takuya \BacklogApiClient \Models \CommentNotification ;
9+ use Takuya \BacklogApiClient \Models \Notification ;
1010use Takuya \BacklogApiClient \Models \Traits \RelateToIssue ;
1111use Takuya \BacklogApiClient \Models \CustomFieldSelectedValue ;
1212
@@ -26,10 +26,9 @@ public function test_notification_relation_to_issue () {
2626 $ api = $ this ->api_client ();
2727 /** @var Issue $issue */
2828 /** @var Comment $comment */
29- /** @var CommentNotification [] $notifications */
29+ /** @var Notification [] $notifications */
3030 [$ notifications , $ comment , $ issue ] = $ this ->find_comment_notifications ();
3131 $ this ->assertNotEmpty ( $ notifications );
32- $ this ->assertEquals ( $ notifications [0 ]->getIssueId (), $ issue ->id );
3332 // クラスへ封入がAPIレスポンスを破壊してないことの確認
3433 $ this ->assertEquals (
3534 json_decode ( $ notifications [0 ]->toJson () ),
You can’t perform that action at this time.
0 commit comments