Example #1
0
 /**
  * Delete action can not be accessed (Permission denied)
  *
  * @throws \Exception
  */
 public function testDeleteActionNoPermission()
 {
     $comment = $this->createComment('Comment for deleting');
     $this->setupUser();
     $this->setExpectedException('Exception');
     $this->commentService->delete($comment->getId());
 }
Example #2
0
 /**
  * Delete action can not be accessed  (Permission denied)
  *
  * @throws \Exception
  */
 public function testDeleteActionNoPermission()
 {
     $entity = $this->createEntityType($this->entityData);
     $this->setupUser();
     $this->setExpectedException('Exception');
     $this->commentService->delete($entity->getId());
     $this->assertResponseStatusCode(403);
 }
Example #3
0
 public function getServiceConfig()
 {
     return array('invokables' => array(), 'factories' => array('comment_repository' => function ($sm) {
         $em = $sm->get('doctrine.entitymanager.orm_default');
         $comment_repository = $em->getRepository('Comment\\Entity\\Comment');
         return $comment_repository;
     }, 'comment_service' => function ($sm) {
         $comment_service = new Service\Comment();
         $comment_service->setRepository($sm->get('comment_repository'));
         $comment_service->setCommentForm($sm->get('comment_form'));
         return $comment_service;
     }, 'comment_form' => function ($sm) {
         $form = new Form\CommentForm();
         $form->setInputFilter(new Form\CommentFilter());
         return $form;
     }));
 }