Bug 24590: Fix Koha/Object.t on MySQL 8

% prove t/db_dependent/Koha/Object.t
is failing on MySQL 8 with:

 kohadev-koha@9bbf9ac68519:/kohadevbox/koha$ prove t/db_dependent/Koha/Object.t
 t/db_dependent/Koha/Object.t .. 15/18
     #   Failed test 'Exception field is correct'
     #   at t/db_dependent/Koha/Object.t line 650.
     #          got: 'api_keys.secret'
     #     expected: 'secret'
     # Looks like you failed 1 test of 16.
 t/db_dependent/Koha/Object.t .. 16/18
 #   Failed test 'store() tests'
 #   at t/db_dependent/Koha/Object.t line 723.

MySQL 8 displays the tablename in the error.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-02-05 10:36:14 +01:00 committed by Martin Renvoize
parent 9eaa4d9775
commit d88dfbf34e
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -647,10 +647,10 @@ subtest 'store() tests' => sub {
'Exception message is correct'
);
is(
like(
$@->duplicate_id,
'secret',
'Exception field is correct'
qr/(api_keys\.)?secret/,
'Exception field is correct (note that MySQL 8 is displaying the tablename)'
);
$schema->storage->dbh->{PrintError} = $print_error;