A free open source IT asset/license management system
Fixed tests for GH
snipe5248d4da7995
diff --git a/tests/Unit/AssetModelTest.php b/tests/Unit/AssetModelTest.phpindex ece6253e0f..49f816e5d7 100644--- a/tests/Unit/AssetModelTest.php+++ b/tests/Unit/AssetModelTest.php@@ -126,9 +126,15 @@ class AssetModelTest extends TestCaseDB::listen(function ($query) use (&$availableCountQueries, $model) {// The availableAssets() relation generates a count(*) on assets// filtered by model_id AND assigned_to IS NULL.- if (str_contains($query->sql, 'count(*)')- && str_contains($query->sql, '"assets"')- && str_contains($query->sql, '"assigned_to" is null')+ //+ // Strip identifier quotes so the matcher works regardless of+ // driver — sqlite emits `"assets"`, MySQL/MariaDB emits backticks.+ // Without this normalization the test passes on the sqlite CI+ // run and fails on the mysql one.+ $normalized = str_replace(['`', '"'], '', $query->sql);+ if (str_contains($normalized, 'count(*)')+ && str_contains($normalized, 'from assets')+ && str_contains($normalized, 'assigned_to is null')&& in_array($model->id, $query->bindings, true)) {$availableCountQueries++;