forked from catchpoint/WebPageTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimersTest.php
40 lines (36 loc) · 1.03 KB
/
TimersTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace WebPageTest;
use PHPUnit\Framework\TestCase;
use WebPageTest\Util\Timers;
final class TimersTest extends TestCase
{
public function testNoTimersReturnsNull(): void
{
$Timers = new Timers();
$setTimers = $Timers->getTimers();
$this->assertNull($setTimers);
}
public function testTimerNoEndReturnsNull(): void
{
$Timers = new Timers();
$Timers->startTimer('db');
$setTimers = $Timers->getTimers();
$this->assertNull($setTimers);
}
public function testTimerWithStartAndEndExists(): void
{
$Timers = new Timers();
$Timers->startTimer('db');
$Timers->endTimer('db');
$setTimers = $Timers->getTimers();
$this->assertStringContainsString('db', $setTimers);
}
public function testTimerNoStartWithEndReturnsNull(): void
{
$Timers = new Timers();
$Timers->endTimer('DNE');
$setTimers = $Timers->getTimers();
$this->assertNull($setTimers);
}
}