mirror of
https://github.com/friendica/friendica
synced 2024-12-23 13:20:21 +00:00
improve tests
This commit is contained in:
parent
3aae84edd1
commit
dddaf8ea1d
1 changed files with 18 additions and 2 deletions
|
@ -189,13 +189,29 @@ class ProfilerTest extends MockedTest
|
|||
}
|
||||
|
||||
/**
|
||||
* Test if no rendertime is set
|
||||
* Test different enable and disable states of the profiler
|
||||
*/
|
||||
public function testNoRenderTime()
|
||||
public function testEnableDisable()
|
||||
{
|
||||
$profiler = new Profiler(true, false);
|
||||
|
||||
$this->assertFalse($profiler->isRendertime());
|
||||
$this->assertEmpty($profiler->getRendertimeString());
|
||||
|
||||
$profiler->saveTimestamp(time(), 'network', 'test1');
|
||||
|
||||
$profiler->update(false, false);
|
||||
|
||||
$this->assertFalse($profiler->isRendertime());
|
||||
$this->assertEmpty($profiler->getRendertimeString());
|
||||
|
||||
$profiler->update(true, true);
|
||||
|
||||
$profiler->saveTimestamp(time(), 'database', 'test2');
|
||||
|
||||
$this->assertTrue($profiler->isRendertime());
|
||||
$output = $profiler->getRendertimeString();
|
||||
$this->assertRegExp('/test1: \d+/', $output);
|
||||
$this->assertRegExp('/test2: \d+/', $output);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue