Bugzilla – Attachment 104590 Details for
Bug 25423
Methods update and empty from Koha::Objects are not class methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25423: Unit tests
Bug-25423-Unit-tests.patch (text/plain), 2.20 KB, created by
Jonathan Druart
on 2020-05-08 13:18:25 UTC
(
hide
)
Description:
Bug 25423: Unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-08 13:18:25 UTC
Size:
2.20 KB
patch
obsolete
>From c7e69ded75c8ffecd7b283e0fedf6e10c54ec0e4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 8 May 2020 08:47:25 -0300 >Subject: [PATCH] Bug 25423: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Objects.t | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index 96a6bc6d30..09d18b210a 100644 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -772,7 +772,7 @@ subtest 'Return same values as DBIx::Class' => sub { > > subtest 'Koha::Objects->update' => sub { > >- plan tests => 4; >+ plan tests => 6; > > my ( $r_us, $e_us, $r_them, $e_them ); > >@@ -853,6 +853,14 @@ subtest 'Return same values as DBIx::Class' => sub { > > ok( $r_us == 2 && $r_them == 2, '->update should return the number of updated cities' ); > ok(!defined($e_us) && !defined($e_them)); >+ >+ throws_ok >+ { Koha::Cities->update({ city_country => 'Castalia' }); } >+ 'Koha::Exceptions::Object::NotInstantiated', >+ 'Exception thrown if not instantiated class'; >+ >+ is( "$@", 'Tried to access the \'update\' method, but Koha::Patrons is not instantiated', 'Exception stringified correctly' ); >+ > }; > }; > >@@ -1090,9 +1098,12 @@ subtest 'empty() tests' => sub { > is( ref($empty), 'Koha::Patrons', '->empty returns a Koha::Patrons iterator' ); > is( $empty->count, 0, 'The empty resultset is, well, empty :-D' ); > >- $empty = Koha::Patrons->empty; >- is( ref($empty), 'Koha::Patrons', 'without being instantiated, ->empty still returns a Koha::Patrons iterator' ); >- is( $empty->count, 0, 'The empty resultset is, well, empty :-D' ); >+ throws_ok >+ { Koha::Patrons->empty; } >+ 'Koha::Exceptions::Object::NotInstantiated', >+ 'Exception thrown if not instantiated class'; >+ >+ is( "$@", 'Tried to access the \'empty\' method, but Koha::Patrons is not instantiated', 'Exception stringified correctly' ); > > $schema->storage->txn_rollback; > }; >-- >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 25423
:
104587
|
104588
|
104589
|
104590
|
104591
|
104592
|
104593
|
104594
|
104595
|
104596
|
104618