Example #1
0
 /**
  * @param Suite $suite
  *
  * @return integer
  */
 public function run(Suite $suite)
 {
     $this->dispatcher->dispatch('beforeSuite', new SuiteEvent($suite));
     $result = 0;
     $startTime = microtime(true);
     foreach ($suite->getSpecifications() as $specification) {
         try {
             $result = max($result, $this->specRunner->run($specification));
         } catch (StopOnFailureException $e) {
             break;
         }
     }
     $endTime = microtime(true);
     $this->dispatcher->dispatch('afterSuite', new SuiteEvent($suite, $endTime - $startTime, $result));
     return $result;
 }
 function let(EventDispatcher $dispatcher, SpecificationRunner $specRunner, Suite $suite, SpecificationNode $spec1, SpecificationNode $spec2)
 {
     $this->beConstructedWith($dispatcher, $specRunner);
     $suite->getSpecifications()->willReturn(array($spec1, $spec2));
 }