From 19e748f0d4a8708d51c0ef55d028d9967f30129f Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Fri, 26 Jan 2024 01:58:03 +0000 Subject: [PATCH] chore: adjusts snapshots --- tests/.snapshots/success.txt | 10 +------ tests/Hooks/AfterAllTest.php | 45 ---------------------------- tests/Hooks/BeforeAllTest.php | 55 ----------------------------------- tests/Visual/Parallel.php | 2 +- 4 files changed, 2 insertions(+), 110 deletions(-) delete mode 100644 tests/Hooks/AfterAllTest.php delete mode 100644 tests/Hooks/BeforeAllTest.php diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index b5298688..71c65700 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -1161,17 +1161,9 @@ PASS Tests\Helpers\TestInHelpers ✓ it executes tests in the Helpers directory - PASS Tests\Hooks\AfterAllTest - ✓ global afterAll execution order - ✓ it only gets called once per file - PASS Tests\Hooks\AfterEachTest ✓ global afterEach execution order - PASS Tests\Hooks\BeforeAllTest - ✓ global beforeAll execution order - ✓ it only gets called once per file - PASS Tests\Hooks\BeforeEachTest ✓ global beforeEach execution order @@ -1412,4 +1404,4 @@ WARN Tests\Visual\Version - visual snapshot of help command output - Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 1003 passed (2407 assertions) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 999 passed (2359 assertions) \ No newline at end of file diff --git a/tests/Hooks/AfterAllTest.php b/tests/Hooks/AfterAllTest.php deleted file mode 100644 index 28335361..00000000 --- a/tests/Hooks/AfterAllTest.php +++ /dev/null @@ -1,45 +0,0 @@ -afterAll(function () { - expect($_SERVER['globalHook']) - ->toHaveProperty('afterAll') - ->and($_SERVER['globalHook']->afterAll) - ->toBe(1) - ->and($_SERVER['globalHook']->calls) - ->afterAll - ->toBe(1); - - $_SERVER['globalHook']->afterAll = 2; - $_SERVER['globalHook']->calls->afterAll++; -}); - -afterAll(function () { - expect($_SERVER['globalHook']) - ->toHaveProperty('afterAll') - ->and($_SERVER['globalHook']->afterAll) - ->toBe(1) - ->and($_SERVER['globalHook']->calls) - ->afterAll - ->toBe(2); - - $_SERVER['globalHook']->afterAll = 2; - $_SERVER['globalHook']->calls->afterAll++; -}); - -test('global afterAll execution order', function () { - expect($_SERVER['globalHook']) - ->not() - ->toHaveProperty('afterAll') - ->and($_SERVER['globalHook']->calls) - ->afterAll - ->toBe(0); -}); - -it('only gets called once per file', function () { - expect($_SERVER['globalHook']) - ->not() - ->toHaveProperty('afterAll') - ->and($_SERVER['globalHook']->calls) - ->afterAll - ->toBe(0); -}); diff --git a/tests/Hooks/BeforeAllTest.php b/tests/Hooks/BeforeAllTest.php deleted file mode 100644 index ae5a8446..00000000 --- a/tests/Hooks/BeforeAllTest.php +++ /dev/null @@ -1,55 +0,0 @@ -calls baseline. This is because -// two other tests are executed before this one due to filename ordering. -$args = $_SERVER['argv'] ?? []; -$single = (isset($args[1]) && Str::endsWith(__FILE__, $args[1])) || Parallel::isWorker(); -$offset = $single ? 0 : 2; - -uses()->beforeAll(function () use ($offset) { - expect($_SERVER['globalHook']) - ->toHaveProperty('beforeAll') - ->and($_SERVER['globalHook']->beforeAll) - ->toBe(1) - ->and($_SERVER['globalHook']->calls) - ->beforeAll - ->toBe(1 + $offset); - - $_SERVER['globalHook']->beforeAll = 2; - $_SERVER['globalHook']->calls->beforeAll++; -}); - -beforeAll(function () use ($offset) { - expect($_SERVER['globalHook']) - ->toHaveProperty('beforeAll') - ->and($_SERVER['globalHook']->beforeAll) - ->toBe(2) - ->and($_SERVER['globalHook']->calls) - ->beforeAll - ->toBe(2 + $offset); - - $_SERVER['globalHook']->beforeAll = 3; - $_SERVER['globalHook']->calls->beforeAll++; -}); - -test('global beforeAll execution order', function () use ($offset) { - expect($_SERVER['globalHook']) - ->toHaveProperty('beforeAll') - ->and($_SERVER['globalHook']->beforeAll) - ->toBe(3) - ->and($_SERVER['globalHook']->calls) - ->beforeAll - ->toBe(3 + $offset); -}); - -it('only gets called once per file', function () use ($offset) { - expect($_SERVER['globalHook']) - ->beforeAll - ->toBe(3) - ->and($_SERVER['globalHook']->calls) - ->beforeAll - ->toBe(3 + $offset); -}); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 76a9ad3d..2534dde0 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -16,7 +16,7 @@ $run = function () { test('parallel', function () use ($run) { expect($run('--exclude-group=integration')) - ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 990 passed (2388 assertions)') + ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 986 passed (2340 assertions)') ->toContain('Parallel: 3 processes'); })->skipOnWindows();