/**
  * Handle Gitlab webhooks
  *
  * @access public
  */
 public function handler()
 {
     $this->checkWebhookToken();
     $gitlabWebhook = new WebhookHandler($this->container);
     $gitlabWebhook->setProjectId($this->request->getIntegerParam('project_id'));
     $result = $gitlabWebhook->parsePayload($this->request->getJson());
     $this->response->text($result ? 'PARSED' : 'IGNORED');
 }
 public function testCommentCreatedWithUser()
 {
     $this->container['dispatcher']->addListener(WebhookHandler::EVENT_ISSUE_COMMENT, array($this, 'onCommentCreatedWithUser'));
     $p = new ProjectModel($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'foobar')));
     $tc = new TaskCreationModel($this->container);
     $this->assertEquals(1, $tc->create(array('title' => 'boo', 'reference' => 1268888, 'project_id' => 1)));
     $u = new UserModel($this->container);
     $this->assertEquals(2, $u->create(array('username' => 'kanboard')));
     $pp = new ProjectUserRoleModel($this->container);
     $this->assertTrue($pp->addUser(1, 2, Role::PROJECT_MEMBER));
     $g = new WebhookHandler($this->container);
     $g->setProjectId(1);
     $this->assertNotFalse($g->parsePayload(json_decode(file_get_contents(__DIR__ . '/fixtures/gitlab_comment_created.json'), true)));
 }