diff --git a/src/Issue/Reporter.php b/src/Issue/Reporter.php index e4d5020f..c639118b 100644 --- a/src/Issue/Reporter.php +++ b/src/Issue/Reporter.php @@ -16,7 +16,7 @@ class Reporter implements \JsonSerializable public ?string $name; - public ?string $emailAddress; + public ?string $emailAddress = null; public array $avatarUrls; diff --git a/test-data/reporter-no-email-address.json b/test-data/reporter-no-email-address.json new file mode 100644 index 00000000..b3a05a60 --- /dev/null +++ b/test-data/reporter-no-email-address.json @@ -0,0 +1,16 @@ +{ + "reporter": { + "self": "https://jira.example.com/rest/api/2/user?username=lesstif", + "name": "lesstif", + "key": "lesstif", + "avatarUrls": { + "48x48": "https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=48", + "24x24": "https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=24", + "16x16": "https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=16", + "32x32": "https://secure.gravatar.com/avatar/9f1705ef1d8c977eba04f00556e02922?d=mm&s=32" + }, + "displayName": "정광섭", + "active": true, + "timeZone": "Asia/Seoul" + } +} \ No newline at end of file diff --git a/tests/MapperTest.php b/tests/MapperTest.php index a74b5e43..49d02452 100644 --- a/tests/MapperTest.php +++ b/tests/MapperTest.php @@ -1,4 +1,4 @@ -mapper->map( + json_decode($ret), new Reporter() + ); + + $this->assertInstanceOf(Reporter::class, $reporter); + + $this->assertEquals('lesstif@gmail.com', $reporter->emailAddress); + } + }