diff --git a/src/applications/nuance/github/NuanceGitHubRawEvent.php b/src/applications/nuance/github/NuanceGitHubRawEvent.php --- a/src/applications/nuance/github/NuanceGitHubRawEvent.php +++ b/src/applications/nuance/github/NuanceGitHubRawEvent.php @@ -91,7 +91,19 @@ } public function getComment() { - return 'TODO: Actually extract comment text.'; + if ($this->type == self::TYPE_REPOSITORY) { + if ($this->isIssueEvent() || $this->isPullRequestEvent()) { + $raw = $this->raw; + + $type = idx($raw, 'type'); + switch ($type) { + case 'IssueCommentEvent': + return idxv($raw, array('payload', 'comment', 'body')); + } + } + } + + return null; } public function getURI() { diff --git a/src/applications/nuance/github/__tests__/NuanceGitHubRawEventTestCase.php b/src/applications/nuance/github/__tests__/NuanceGitHubRawEventTestCase.php --- a/src/applications/nuance/github/__tests__/NuanceGitHubRawEventTestCase.php +++ b/src/applications/nuance/github/__tests__/NuanceGitHubRawEventTestCase.php @@ -51,6 +51,7 @@ 'id' => $event->getID(), 'uri' => $event->getURI(), 'title.full' => $event->getEventFullTitle(), + 'comment' => $event->getComment(), ); // Only verify the keys which are actually present in the test. This diff --git a/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.pull.txt b/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.pull.txt --- a/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.pull.txt +++ b/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.pull.txt @@ -160,5 +160,6 @@ "pull.number": 2, "id": 3740938746, "uri": "https://github.com/epriestley/poems/pull/2#issuecomment-194282800", - "title.full": "GitHub epriestley/poems Pull Request #2 (Comment)" + "title.full": "GitHub epriestley/poems Pull Request #2 (Comment)", + "comment": "wub wub" } diff --git a/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.txt b/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.txt --- a/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.txt +++ b/src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.txt @@ -97,5 +97,6 @@ "issue.number": 1, "id": 3733510485, "uri": "https://github.com/epriestley/poems/issues/1#issuecomment-193528669", - "title.full": "GitHub epriestley/poems Issue #1 (Comment)" + "title.full": "GitHub epriestley/poems Issue #1 (Comment)", + "comment": "comment on issue" }