Bugzilla – Attachment 103811 Details for
Bug 25296
Add a way to force an empty Koha::Objects resultset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25296: Unit tests
Bug-25296-Unit-tests.patch (text/plain), 1.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-04-27 21:37:11 UTC
(
hide
)
Description:
Bug 25296: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-04-27 21:37:11 UTC
Size:
1.31 KB
patch
obsolete
>From 64ee8f99d3d9540a64a4f9a964c62ae3643492a4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 27 Apr 2020 18:32:50 -0300 >Subject: [PATCH] Bug 25296: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Objects.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index c5ac1ba2b6..2af778a85a 100644 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 22; > use Test::Exception; > use Test::Warn; > >@@ -799,3 +799,20 @@ subtest 'prefetch_whitelist() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'empty() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ # Add a patron, we need more than 0 >+ $builder->build_object({ class => 'Koha::Patrons' }); >+ ok( Koha::Patrons->count > 0, 'There is more than one Koha::Patron on the resultset' ); >+ >+ my $empty = Koha::Patrons->new->empty; >+ is( ref($empty), 'Koha::Patrons', '->empty returns a Koha::Patrons iterator' ); >+ is( $empty->count, 0, 'The empty resultset is, well, empty :-D' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.26.2
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 25296
:
103811
|
103812
|
103860
|
103861
|
103928
|
103929
|
103934
|
103935
|
103936
|
103937