예제 #1
0
 public function testNotSocietyOwner()
 {
     $show = new Show();
     $society = new Society();
     $society->setName('Test Society');
     $show->setSociety($society);
     $this->aclProvider->expects($this->atLeastOnce())->method('isOwner')->with($this->user, $society)->will($this->returnValue(false));
     $this->assertEquals(ShowVoter::ACCESS_DENIED, $this->voter->vote($this->token, $show, array('EDIT')));
     $this->assertEquals(ShowVoter::ACCESS_DENIED, $this->voter->vote($this->token, $show, array('APPROVE')));
 }
예제 #2
0
 private function allocateSociety(Show $show)
 {
     if (mt_rand(0, 3) == 0) {
         $show->setOtherSociety('Random Society ' . mt_rand(1, 100));
     } else {
         $show->setSociety($this->society_repo->findOneById($this->society_ids[mt_rand(0, count($this->society_ids) - 1)]));
     }
 }