Skip to content

Commit 1cabe2d

Browse files
authored
feat(core): add TEMPEST_START constant (#791)
1 parent c1be5e6 commit 1cabe2d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Tempest/Core/src/Kernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public static function boot(
3939
array $discoveryLocations = [],
4040
?Container $container = null,
4141
): self {
42+
define('TEMPEST_START', value: hrtime(true));
43+
4244
return (new self(
4345
root: $root,
4446
discoveryLocations: $discoveryLocations,

tests/Integration/Core/KernelTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ public function test_discovery_boot(): void
3434
$this->assertInstanceOf(TestDependency::class, $test);
3535
$this->assertSame('test', $test->input);
3636
}
37+
38+
public function test_kernel_start(): void
39+
{
40+
Kernel::boot(
41+
root: getcwd(),
42+
discoveryLocations: [],
43+
);
44+
45+
$this->assertTrue(defined('TEMPEST_START'));
46+
}
3747
}

0 commit comments

Comments
 (0)