Esempio n. 1
0
 public function testHandleEvent()
 {
     $this->if($field = new test\duration\cli())->and($score = new \mock\mageekguy\atoum\score())->and($score->getMockController()->getTotalDuration = function () use(&$runningDuration) {
         return $runningDuration = rand(0, PHP_INT_MAX);
     })->and($adapter = new adapter())->and($adapter->class_exists = true)->and($testController = new mock\controller())->and($testController->getTestedClassName = uniqid())->and($testController->getScore = $score)->and($test = new \mock\mageekguy\atoum\test($adapter))->then->boolean($field->handleEvent(atoum\runner::runStop, $test))->isFalse()->variable($field->getValue())->isNull()->boolean($field->handleEvent(atoum\test::runStop, $test))->isTrue()->integer($field->getValue())->isEqualTo($runningDuration);
 }