public function testGetEventType() { $g = new GitlabWebhook($this->container); $this->assertEquals(GitlabWebhook::TYPE_PUSH, $g->getType(json_decode($this->push_payload, true))); $this->assertEquals(GitlabWebhook::TYPE_ISSUE, $g->getType(json_decode($this->issue_open_payload, true))); $this->assertEquals(GitlabWebhook::TYPE_ISSUE, $g->getType(json_decode($this->issue_closed_payload, true))); $this->assertEquals('', $g->getType(array())); }
public function testGetEventType() { $g = new GitlabWebhook($this->container); $this->assertEquals(GitlabWebhook::TYPE_PUSH, $g->getType(json_decode(file_get_contents(__DIR__ . '/fixtures/gitlab_push.json'), true))); $this->assertEquals(GitlabWebhook::TYPE_ISSUE, $g->getType(json_decode(file_get_contents(__DIR__ . '/fixtures/gitlab_issue_opened.json'), true))); $this->assertEquals(GitlabWebhook::TYPE_COMMENT, $g->getType(json_decode(file_get_contents(__DIR__ . '/fixtures/gitlab_comment_created.json'), true))); $this->assertEquals('', $g->getType(array())); }