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'))); }
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)])); } }