Bugzilla – Attachment 94654 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.43 KB, created by
Jonathan Druart
on 2019-10-24 10:51:37 UTC
(
hide
)
Description:
Bug 23825: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-10-24 10:51:37 UTC
Size:
1.43 KB
patch
obsolete
>From c6e24cddd0f3cce680a90090b5a8d2374cf10f30 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 > >--- > 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..29519f1c5e 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' ); >+ is( $_->property, 'borrowers.lastseen', 'Column should be the expected one' ); >+ is( $_->value, 'wrong_value', 'Value should be the expected one' ); >+ }; > > $schema->storage->dbh->{PrintError} = $print_error; > }; >-- >2.11.0
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