Bugzilla – Attachment 83658 Details for
Bug 22051
Make Koha::Object->store translate 'Incorrect <type> value' exceptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22051: Unit tests
Bug-22051-Unit-tests.patch (text/plain), 1.53 KB, created by
Charles Farmer
on 2019-01-04 19:44:37 UTC
(
hide
)
Description:
Bug 22051: Unit tests
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2019-01-04 19:44:37 UTC
Size:
1.53 KB
patch
obsolete
>From eb1e100aed150abb04f1bdc6f88b00a4d85abb6c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 28 Dec 2018 12:15:36 -0300 >Subject: [PATCH] Bug 22051: Unit tests > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> >--- > t/db_dependent/Koha/Object.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index ca0ef5f..cf40ea9 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -242,7 +242,7 @@ subtest "Test update method" => sub { > > subtest 'store() tests' => sub { > >- plan tests => 7; >+ plan tests => 8; > > # Using Koha::ApiKey to test Koha::Object>-store > # Simple object with foreign keys and unique key >@@ -306,6 +306,23 @@ subtest 'store() tests' => sub { > my $ret = $api_key->store; > is( ref($ret), 'Koha::ApiKey', 'store() returns the object on success' ); > >+ subtest 'Bad value tests' => sub { >+ >+ plan tests => 1; >+ >+ 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'; >+ >+ $schema->storage->dbh->{PrintError} = $print_error; >+ }; >+ > $schema->storage->txn_rollback; > }; > >-- >2.7.4
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 22051
:
83534
|
83535
|
83536
|
83622
|
83623
|
83624
|
83657
|
83658
|
83659
|
83723
|
83724
|
83725