Bugzilla – Attachment 113638 Details for
Bug 27021
Chaining on Koha::Objects->empty should always return an empty resultset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27021: Regression tests
Bug-27021-Regression-tests.patch (text/plain), 1.70 KB, created by
Martin Renvoize (ashimema)
on 2020-11-14 07:58:30 UTC
(
hide
)
Description:
Bug 27021: Regression tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-14 07:58:30 UTC
Size:
1.70 KB
patch
obsolete
>From 71b5f3e0416cd2452de32675d77b380f38525447 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 13 Nov 2020 15:47:39 -0300 >Subject: [PATCH] Bug 27021: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Objects.t | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index 76e0393485..265d327c4e 100755 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -1204,18 +1204,22 @@ subtest 'prefetch_whitelist() tests' => sub { > > subtest 'empty() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $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' ); >+ # Add a patron, we need at least 1 >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ ok( Koha::Patrons->count > 0, 'There is at least 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' ); > >+ my $new_rs = $empty->search({ borrowernumber => $patron->borrowernumber }); >+ >+ is( $new_rs->count, 0, 'Further chaining an empty resultset, returns an empty resultset' ); >+ > throws_ok > { Koha::Patrons->empty; } > 'Koha::Exceptions::Object::NotInstantiated', >-- >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 27021
:
113626
|
113627
|
113636
|
113637
| 113638 |
113639