コード例 #1
0
 private function newRawEvent(NuanceItem $item)
 {
     $type = $item->getItemProperty('api.type');
     $raw = $item->getItemProperty('api.raw', array());
     return NuanceGitHubRawEvent::newEvent($type, $raw);
 }
コード例 #2
0
 private function assertGitHubRawEventParse(array $expect, NuanceGitHubRawEvent $event, $name)
 {
     $actual = array('repository.name.full' => $event->getRepositoryFullName(), 'is.issue' => $event->isIssueEvent(), 'is.pull' => $event->isPullRequestEvent(), 'issue.number' => $event->getIssueNumber(), 'pull.number' => $event->getPullRequestNumber(), 'id' => $event->getID(), 'uri' => $event->getURI(), 'title.full' => $event->getEventFullTitle(), 'comment' => $event->getComment(), 'actor.id' => $event->getActorGitHubUserID());
     // Only verify the keys which are actually present in the test. This
     // allows tests to specify only relevant keys.
     $actual = array_select_keys($actual, array_keys($expect));
     ksort($expect);
     ksort($actual);
     $this->assertEqual($expect, $actual, $name);
 }