Skip to content

Commit

Permalink
Add waypoint code.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbaggett committed Jul 11, 2019
2 parents 2f7376d + 9f05119 commit d608f4a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TestCase extends \PHPUnit\Framework\TestCase

private $defaultEnvironment = [];
private $defaultHeaders = [];
private $startTime;

public static function setUpBeforeClass()
{
Expand All @@ -49,6 +50,7 @@ public function setUp()
'RAND' => rand(0, 100000000),
];
$this->defaultHeaders = [];
$this->startTime = microtime(true);
if (class_exists('Kint')) {
\Kint::$max_depth = 0;
}
Expand Down Expand Up @@ -136,6 +138,15 @@ public function request(
return $response;
}

protected function waypoint(string $label) : void
{
printf(
"[%s] %s\n",
number_format(microtime(true) - $this->startTime),
$label
);
}

protected function setEnvironmentVariable($key, $value)
{
$this->defaultEnvironment[$key] = $value;
Expand Down

0 comments on commit d608f4a

Please sign in to comment.