Added markIncompleteIfSqlite() method

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-03 22:18:31 +01:00
parent 17a6335d13
commit 5e15cc3bbe
2 changed files with 9 additions and 0 deletions

View file

@ -147,6 +147,8 @@ class UserSearchTest extends TestCase
public function testUsersIndexWhenInvalidSortFieldIsPassed() public function testUsersIndexWhenInvalidSortFieldIsPassed()
{ {
$this->markIncompleteIfSqlite('This test is not compatible with SQLite');
$this->actingAsForApi(User::factory()->viewUsers()->create()) $this->actingAsForApi(User::factory()->viewUsers()->create())
->getJson(route('api.users.index', [ ->getJson(route('api.users.index', [
'sort' => 'assets', 'sort' => 'assets',

View file

@ -10,4 +10,11 @@ trait CanSkipTests
$this->markTestIncomplete($message); $this->markTestIncomplete($message);
} }
} }
public function markIncompleteIfSqlite($message = 'Test skipped due to database driver being sqlite.')
{
if (config('database.default') === 'sqlite') {
$this->markTestIncomplete($message);
}
}
} }