File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class Reporter implements \JsonSerializable
1616
1717 public ?string $ name ;
1818
19- public ?string $ emailAddress ;
19+ public ?string $ emailAddress = null ;
2020
2121 public array $ avatarUrls ;
2222
Original file line number Diff line number Diff line change 1+ {
2+ "reporter" : {
3+ "self" : " https://jira.example.com/rest/api/2/user?username=lesstif" ,
4+ "name" : " lesstif" ,
5+ "key" : " lesstif" ,
6+ "avatarUrls" : {
7+ "48x48" : " https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=48" ,
8+ "24x24" : " https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=24" ,
9+ "16x16" : " https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=16" ,
10+ "32x32" : " https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=32"
11+ },
12+ "displayName" : " 정광섭" ,
13+ "active" : true ,
14+ "timeZone" : " Asia/Seoul"
15+ }
16+ }
Original file line number Diff line number Diff line change 1- <?php
1+ <?php declare (strict_types= 1 );
22
33namespace JiraRestApi \Test ;
44
@@ -89,4 +89,17 @@ public function testIssue()
8989
9090 }
9191
92+ public function testReporterField ()
93+ {
94+ $ ret = file_get_contents ('test-data/reporter-no-email-address.json ' );
95+
96+ $ reporter = $ this ->mapper ->map (
97+ json_decode ($ ret ), new Reporter ()
98+ );
99+
100+ $ this ->assertInstanceOf (Reporter::class, $ reporter );
101+
102+ $ this ->
assertEquals (
'[email protected] ' ,
$ reporter->
emailAddress );
103+ }
104+
92105}
You can’t perform that action at this time.
0 commit comments