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
16
16
17
17
public ?string $ name ;
18
18
19
- public ?string $ emailAddress ;
19
+ public ?string $ emailAddress = null ;
20
20
21
21
public array $ avatarUrls ;
22
22
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 );
2
2
3
3
namespace JiraRestApi \Test ;
4
4
@@ -89,4 +89,17 @@ public function testIssue()
89
89
90
90
}
91
91
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
+
92
105
}
You can’t perform that action at this time.
0 commit comments