예제 #1
0
 /**
  * Test that it throws an exception when we hit the query limit
  *
  * @return void
  */
 public function test_it_throws_exception_on_query_limit()
 {
     $this->setExpectedException('Warden\\Exceptions\\LimitExceededException');
     $this->warden->start();
     // Le wild query in a loop appears
     for ($i = 0; $i < 10; $i++) {
         $result = $this->em->getRepository('Warden\\Tests\\Collector\\Doctrine\\Entities\\Test')->findBy([], [], null, null);
     }
     $this->warden->stop();
 }
예제 #2
0
 /**
  * Test that the governor class triggers exceptions
  *
  * @return void
  */
 public function test_governor_triggers_exceptions()
 {
     $this->setExpectedException('Warden\\Exceptions\\LimitExceededException');
     $warden = new Warden();
     $warden->addGovernor(new TestGovernor());
     $warden->start();
     $d = $warden->getGovernor('testGov');
     $d->getAValue();
     $warden->stop();
 }