public function testAllEvent() { $this->modelEvent = new CommentsEventModel(); $state = $this->modelEvent->insertCommentEvent(1, 1, 'Trop SWAG'); $this->assertEquals(true, $state); $array = $this->modelEvent->getCommentsForEvent(1); $this->assertNotEmpty($array); $state = $this->modelEvent->deleteCommentEvent(0); $this->assertEquals(true, $state); }
public function commentPOST() { if (!Authentication::getInstance()->isAuthenticated()) { throw new NotAuthenticatedException(); } $id = (int) $this->getParams()[0]; $this->eventCommentModel->insertCommentEvent(Authentication::getInstance()->getUserId(), $id, Input::post('message')); $this->getView()->redirect('/event/show/' . $id); }