test(flights): match bids query dialect-agnostically

MySQL quotes identifiers with backticks, not double quotes, so the
from "bids" match found nothing on the mysql CI job. Strip both quote
styles before matching.
This commit is contained in:
Nabeel Shahzad 2026-07-06 17:37:32 -05:00
parent bb82e1fd8c
commit 7875219fdb
No known key found for this signature in database
GPG Key ID: 08C44114D2BF3047

View File

@ -123,8 +123,10 @@ test('browse search with bid resolves all bids in a single batched query', funct
DB::connection()->enableQueryLog(); DB::connection()->enableQueryLog();
freshRequestState(); freshRequestState();
$this->get('/api/flights/search?with=bid')->assertStatus(200); $this->get('/api/flights/search?with=bid')->assertStatus(200);
// Normalize identifier quoting (postgres/sqlite use ", mysql uses `) so the
// match is dialect-agnostic across the CI matrix.
$bidQueries = collect(DB::connection()->getQueryLog()) $bidQueries = collect(DB::connection()->getQueryLog())
->filter(fn (array $q): bool => str_contains((string) $q['query'], 'from "bids"')) ->filter(fn (array $q): bool => str_contains(str_replace(['`', '"'], '', (string) $q['query']), 'from bids'))
->count(); ->count();
DB::connection()->disableQueryLog(); DB::connection()->disableQueryLog();