From a5c79d49c38d85ee26d3223fd89876309b8e27d3 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 14 Jan 2025 15:51:48 +0100 Subject: [PATCH] Static property cleanup in afterEach --- tests/RLS/PolicyTest.php | 4 ++++ tests/RLS/TableManagerTest.php | 4 ++++ tests/RLS/TraitManagerTest.php | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/tests/RLS/PolicyTest.php b/tests/RLS/PolicyTest.php index 6df8e9ca..c2562652 100644 --- a/tests/RLS/PolicyTest.php +++ b/tests/RLS/PolicyTest.php @@ -79,6 +79,10 @@ beforeEach(function () { }); }); +afterEach(function () { + CreateUserWithRLSPolicies::$forceRls = true; +}); + // Regression test for https://github.com/archtechx/tenancy/pull/1280 test('rls command doesnt fail when a view is in the database', function (string $manager) { DB::statement(" diff --git a/tests/RLS/TableManagerTest.php b/tests/RLS/TableManagerTest.php index bbd400a7..723ae3da 100644 --- a/tests/RLS/TableManagerTest.php +++ b/tests/RLS/TableManagerTest.php @@ -107,6 +107,10 @@ beforeEach(function () { }); }); +afterEach(function () { + CreateUserWithRLSPolicies::$forceRls = true; +}); + test('correct rls policies get created with the correct hash using table manager', function() { $manager = app(config('tenancy.rls.manager')); diff --git a/tests/RLS/TraitManagerTest.php b/tests/RLS/TraitManagerTest.php index 4c3f3b26..4ca814da 100644 --- a/tests/RLS/TraitManagerTest.php +++ b/tests/RLS/TraitManagerTest.php @@ -78,6 +78,10 @@ beforeEach(function () { }); }); +afterEach(function () { + CreateUserWithRLSPolicies::$forceRls = true; +}); + test('correct rls policies get created with the correct hash using trait manager', function () { $manager = app(TraitRLSManager::class);