From 7249b59e5218e2e6af37d1fa99e4deff021bd4a3 Mon Sep 17 00:00:00 2001 From: salehhashemi1992 <81674631+salehhashemi1992@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:51:02 +0330 Subject: [PATCH] fix lifecycle hook scope --- tests/Features/TestCycle.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Features/TestCycle.php b/tests/Features/TestCycle.php index 37b6d092..739d3a39 100644 --- a/tests/Features/TestCycle.php +++ b/tests/Features/TestCycle.php @@ -8,16 +8,16 @@ $foo->beforeEach = false; $foo->afterEach = false; $foo->afterAll = false; -beforeAll(function () { +beforeAll(function () use ($foo) { $foo->beforeAll = true; }); -beforeEach(function () { +beforeEach(function () use ($foo) { $foo->beforeEach = true; }); -afterEach(function () { +afterEach(function () use ($foo) { $foo->afterEach = true; }); -afterAll(function () { +afterAll(function () use ($foo) { $foo->afterAll = true; });