Пример #1
0
 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);
 }
Пример #2
0
 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);
 }
 public function delete()
 {
     $id = (int) $this->getParams()[0];
     $this->modelComment = $this->loadModel('CommentsEvent');
     $this->modelComment->deleteCommentEvent($id);
 }