mageekguy\atoum\runner::getRunningDuration PHP Method

getRunningDuration() public method

public getRunningDuration ( )
    public function getRunningDuration()
    {
        return $this->start === null || $this->stop === null ? null : $this->stop - $this->start;
    }

Usage Example

示例#1
0
 public function testGetRunningDuration()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->microtime = function () {
         static $call = 0;
         return ++$call * 100;
     })->and($adapter->get_declared_classes = array())->and($runner = new testedClass())->and($runner->setAdapter($adapter))->then->variable($runner->getRunningDuration())->isNull()->if($runner->run())->then->integer($runner->getRunningDuration())->isEqualTo(100)->if(eval('namespace ' . __NAMESPACE__ . ' { class forTestGetRunningDuration extends \\mageekguy\\atoum\\test { public function testSomething() {} public function run(array $runTestMethods = array(), array $tags = array()) { return $this; } } }'))->and($adapter->get_declared_classes = array(__NAMESPACE__ . '\\forTestGetRunningDuration'))->and($runner->run())->then->integer($runner->getRunningDuration())->isEqualTo(100);
 }
All Usage Examples Of mageekguy\atoum\runner::getRunningDuration
runner