Esempio n. 1
0
 public function testOnFindAfterNoRequest()
 {
     $this->securityFacade->expects($this->never())->method($this->anything());
     $object = new \stdClass();
     $event = new FindAfter($object);
     $this->listener->onFindAfter($event);
 }
Esempio n. 2
0
 /**
  * @dataProvider onFindAfterProvider
  */
 public function testOnFindAfter($isGranted, $throwExeption)
 {
     $object = new \stdClass();
     $this->securityFacade->expects($this->once())->method('isRequestObjectIsGranted')->with($this->request, $object)->will($this->returnValue($isGranted));
     if ($throwExeption) {
         $this->setExpectedException('Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException');
     }
     $event = new FindAfter($object);
     $this->listener->onFindAfter($event);
 }