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:
parent
bb82e1fd8c
commit
7875219fdb
@ -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();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user