Bugzilla – Attachment 95403 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: Add tests
Bug-23825-Add-tests.patch (text/plain), 1.66 KB, created by
Martin Renvoize (ashimema)
on 2019-11-13 16:17:19 UTC
(
hide
)
Description:
Bug 23825: Add tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-13 16:17:19 UTC
Size:
1.66 KB
patch
obsolete
>From 8aaab5a4f2c1306bb24ba3b5442b4222115a4a92 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 24 Oct 2019 12:51:19 +0200 >Subject: [PATCH] Bug 23825: Add tests > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >[EDIT] >Changed 'is' to 'like' with regex since we also have the db name. >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Object.t | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 7570b62afe..2a54225c97 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -399,17 +399,20 @@ subtest 'store() tests' => sub { > > subtest 'Bad value tests' => sub { > >- plan tests => 1; >+ plan tests => 3; > > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > my $print_error = $schema->storage->dbh->{PrintError}; > $schema->storage->dbh->{PrintError} = 0; > >- throws_ok >- { $patron->lastseen('wrong_value')->store; } >- 'Koha::Exceptions::Object::BadValue', >- 'Exception thrown correctly'; >+ try { >+ $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 >+ is( $_->value, 'wrong_value', 'Value should be the expected one' ); >+ }; > > $schema->storage->dbh->{PrintError} = $print_error; > }; >-- >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