Bugzilla – Attachment 95404 Details for
Bug 23825
Object.t is failing - Exception not caught
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23825: (QA follow-up) Remove database name
Bug-23825-QA-follow-up-Remove-database-name.patch (text/plain), 2.46 KB, created by
Martin Renvoize (ashimema)
on 2019-11-13 16:17:23 UTC
(
hide
)
Description:
Bug 23825: (QA follow-up) Remove database name
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-13 16:17:23 UTC
Size:
2.46 KB
patch
obsolete
>From 8de514bca9b3edf5d4718df926b7c58513a7c45e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 Oct 2019 09:00:26 +0000 >Subject: [PATCH] Bug 23825: (QA follow-up) Remove database name > >As requested on comment15. > >Test plan: >Run t/db_dependent/Koha/Object.t again > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Object.pm | 13 ++++++++----- > t/db_dependent/Koha/Object.t | 2 +- > 2 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index f764e5ec0b..a92e870c40 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -174,12 +174,15 @@ sub store { > duplicate_id => $+{key} > ); > } >- elsif( $_->{msg} =~ /Incorrect (?<type>\w+) value: '(?<value>.*)' for column \W?(?<property>\S+)/ ) { >- # The optional \W in the regex might be a quote or backtick >+ elsif( $_->{msg} =~ /Incorrect (?<type>\w+) value: '(?<value>.*)' for column \W?(?<property>\S+)/ ) { # The optional \W in the regex might be a quote or backtick >+ my $type = $+{type}; >+ my $value = $+{value}; >+ my $property = $+{property}; >+ $property =~ s/['`]//g; > Koha::Exceptions::Object::BadValue->throw( >- type => $+{type}, >- value => $+{value}, >- property => $+{property}, >+ type => $type, >+ value => $value, >+ property => $property =~ /(\w+\.\w+)$/ ? $1 : $property, # results in table.column without quotes or backtics > ); > } > } >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 2a54225c97..af723528c6 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -410,7 +410,7 @@ subtest 'store() tests' => sub { > $patron->lastseen('wrong_value')->store; > } catch { > ok( $_->isa('Koha::Exceptions::Object::BadValue'), 'Exception thrown correctly' ); >- like( $_->property, qr/borrowers\W?\.\W?lastseen/, 'Column should be the expected one' ); # optional \W for quote or backtic >+ like( $_->property, qr/borrowers\.lastseen/, 'Column should be the expected one' ); > is( $_->value, 'wrong_value', 'Value should be the expected one' ); > }; > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23825
:
94401
|
94654
|
94661
|
94662
|
94803
|
94804
|
95044
|
95053
|
95402
|
95403
| 95404 |
95405