3 namespace Doctrine\Tests;
6 * Description of DoctrinePerformanceTestCase
10 class OrmPerformanceTestCase extends OrmFunctionalTestCase
15 protected $maxRunningTime = 0;
19 protected function runTest()
23 $time = microtime(true) - $s;
25 if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) {
28 'expected running time: <= %s but was: %s',
30 $this->maxRunningTime,
38 * @param integer $maxRunningTime
39 * @throws InvalidArgumentException
40 * @since Method available since Release 2.3.0
42 public function setMaxRunningTime($maxRunningTime)
44 if (is_integer($maxRunningTime) && $maxRunningTime >= 0) {
45 $this->maxRunningTime = $maxRunningTime;
47 throw new \InvalidArgumentException;
53 * @since Method available since Release 2.3.0
55 public function getMaxRunningTime()
57 return $this->maxRunningTime;