Bugzilla – Attachment 129065 Details for
Bug 29807
Branches template plugin doesn't handle empty lists correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29807: Regression tests
Bug-29807-Regression-tests.patch (text/plain), 2.02 KB, created by
Owen Leonard
on 2022-01-06 13:24:26 UTC
(
hide
)
Description:
Bug 29807: Regression tests
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-01-06 13:24:26 UTC
Size:
2.02 KB
patch
obsolete
>From 48caeba3e583414b9bd7da74228135de287f3d4f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 6 Jan 2022 08:53:01 -0300 >Subject: [PATCH] Bug 29807: Regression tests > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > t/db_dependent/Template/Plugin/Branches.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Template/Plugin/Branches.t b/t/db_dependent/Template/Plugin/Branches.t >index 377a36e061..3957887525 100755 >--- a/t/db_dependent/Template/Plugin/Branches.t >+++ b/t/db_dependent/Template/Plugin/Branches.t >@@ -112,7 +112,7 @@ subtest 'all() tests' => sub { > > subtest 'pickup_locations() tests' => sub { > >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -168,6 +168,27 @@ subtest 'pickup_locations() tests' => sub { > is( scalar @{$pickup_locations}, 1, 'Only the library returned by $biblio->pickup_locations is returned' ); > is( $pickup_locations->[0]->{branchcode}, $library_2->branchcode, 'Not cheating' ); > >+ subtest 'Koha::Item->pickup_locations and Koha::Biblio->pickup_locations empty tests' => sub { >+ >+ plan tests => 2; >+ >+ my $biblio_class = Test::MockModule->new('Koha::Biblio'); >+ $biblio_class->mock( 'pickup_locations', sub { return Koha::Libraries->new->empty } ); >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ my @pickup_locations = @{$plugin->pickup_locations({ search_params => { biblio => $biblio->id } })}; >+ is( scalar @pickup_locations, 0, 'No pickup locations returned' ); >+ >+ my $item_class = Test::MockModule->new('Koha::Item'); >+ $item_class->mock( 'pickup_locations', sub { return Koha::Libraries->new->empty } ); >+ >+ my $item = $builder->build_sample_item; >+ >+ @pickup_locations = @{$plugin->pickup_locations({ search_params => { item => $item->id } })}; >+ is( scalar @pickup_locations, 0, 'No pickup locations returned' ); >+ }; >+ > subtest 'selected tests' => sub { > > plan tests => 4; >-- >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 29807
:
129056
|
129057
|
129065
|
129066
|
129080
|
129081