From 5e15cc3bbe4267d7d164e126af497a7789b69707 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 3 Jul 2024 22:18:31 +0100 Subject: [PATCH] Added markIncompleteIfSqlite() method Signed-off-by: snipe --- tests/Feature/Users/Api/UserSearchTest.php | 2 ++ tests/Support/CanSkipTests.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/tests/Feature/Users/Api/UserSearchTest.php b/tests/Feature/Users/Api/UserSearchTest.php index fba18e67ea..dc0ffdc803 100644 --- a/tests/Feature/Users/Api/UserSearchTest.php +++ b/tests/Feature/Users/Api/UserSearchTest.php @@ -147,6 +147,8 @@ class UserSearchTest extends TestCase public function testUsersIndexWhenInvalidSortFieldIsPassed() { + $this->markIncompleteIfSqlite('This test is not compatible with SQLite'); + $this->actingAsForApi(User::factory()->viewUsers()->create()) ->getJson(route('api.users.index', [ 'sort' => 'assets', diff --git a/tests/Support/CanSkipTests.php b/tests/Support/CanSkipTests.php index 2a1eec10fc..b29fdf88cd 100644 --- a/tests/Support/CanSkipTests.php +++ b/tests/Support/CanSkipTests.php @@ -10,4 +10,11 @@ trait CanSkipTests $this->markTestIncomplete($message); } } + + public function markIncompleteIfSqlite($message = 'Test skipped due to database driver being sqlite.') + { + if (config('database.default') === 'sqlite') { + $this->markTestIncomplete($message); + } + } }