diff --git a/tests/Hooks/BeforeAllTest.php b/tests/Hooks/BeforeAllTest.php new file mode 100644 index 000000000..553390d3e --- /dev/null +++ b/tests/Hooks/BeforeAllTest.php @@ -0,0 +1,19 @@ +beforeAll(function () { + $_SERVER['beforeAllCalls']++; + + expect($_SERVER['beforeAllCalls'])->toBe(1); +}); + +beforeAll(function () { + $_SERVER['beforeAllCalls']++; + + expect($_SERVER['beforeAllCalls'])->toBe(2); +}); + +test('beforeAll is called', function () { + expect($_SERVER['beforeAllCalls'])->toBe(2); +}); diff --git a/tests/Pest.php b/tests/Pest.php index a938fc7e4..13f9956c5 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -73,7 +73,9 @@ expect($_SERVER['globalHook']) ->toHaveProperty('afterAll') ->and($_SERVER['globalHook']->afterAll) - ->toBe(0); + ->toBe(0) + ->and($_SERVER['beforeAll']) + ->toBe(1); $_SERVER['globalHook']->afterAll = 1; });