From 649c0b2df7e288488fe016408f90440041ff59fb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Feb 2020 10:36:14 +0100 Subject: [PATCH] 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 Signed-off-by: Joy Nelson (cherry picked from commit d5cd348c27b0c0d18474d11a8b78d1e2468f9a7a) Signed-off-by: Lucas Gass --- t/db_dependent/Koha/Object.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t index bcdee8de31..3556f6ede4 100755 --- a/t/db_dependent/Koha/Object.t +++ b/t/db_dependent/Koha/Object.t @@ -293,10 +293,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; -- 2.20.1