From b273d126e6c1c67cdf2932e6200a2003a54d22a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 30 Dec 2024 23:58:49 +0100 Subject: [PATCH] verify and slightly refactor regression test --- tests/RLS/PolicyTest.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/RLS/PolicyTest.php b/tests/RLS/PolicyTest.php index 6ad51cee..7c7165bc 100644 --- a/tests/RLS/PolicyTest.php +++ b/tests/RLS/PolicyTest.php @@ -78,7 +78,8 @@ beforeEach(function () { }); }); -test('rls command succeeds when a view is in the database', function (string $manager) { +// 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(" CREATE VIEW post_comments AS SELECT @@ -94,17 +95,12 @@ test('rls command succeeds when a view is in the database', function (string $ma config(['tenancy.rls.manager' => $manager]); - try { - pest()->artisan('tenants:rls'); - - pest()->assertTrue(true); - } catch (\Exception $e) { - pest()->assertTrue(false); - } + // throws an exception without the patch + pest()->artisan('tenants:rls'); })->with([ TableRLSManager::class, TraitRLSManager::class, -]); +])->throwsNoExceptions(); test('postgres user gets created using the rls command', function(string $manager) { config(['tenancy.rls.manager' => $manager]);