Skip to content

Commit fb71fb4

Browse files
committed
test: load mock once using setUpBeforeClass()
1 parent effc6ad commit fb71fb4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/system/Debug/ToolbarTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
use PHPUnit\Framework\Attributes\BackupGlobals;
2525
use PHPUnit\Framework\Attributes\Group;
2626

27-
require_once SUPPORTPATH . 'Mock/MockNativeHeaders.php';
28-
2927
/**
3028
* @internal
3129
*/
@@ -37,6 +35,14 @@ final class ToolbarTest extends CIUnitTestCase
3735
private ?IncomingRequest $request = null;
3836
private ?ResponseInterface $response = null;
3937

38+
public static function setUpBeforeClass(): void
39+
{
40+
parent::setUpBeforeClass();
41+
42+
// Load the mock once for the whole test class
43+
require_once SUPPORTPATH . 'Mock/MockNativeHeaders.php';
44+
}
45+
4046
protected function setUp(): void
4147
{
4248
parent::setUp();

0 commit comments

Comments
 (0)