From 81498970d1f1ca9be6e1a01a1d8e5c571015ed4b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 12 Jan 2017 15:05:15 +0100 Subject: [PATCH] Bug 17273: Add tests for Virtualshelf->list_biblionumbers Content-Type: text/plain; charset=utf-8 Test plan: Run t/db_dependent/Virtualshelves.t Signed-off-by: Marcel de Rooy --- t/db_dependent/Virtualshelves.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t index c867056..80e9fdd 100644 --- a/t/db_dependent/Virtualshelves.t +++ b/t/db_dependent/Virtualshelves.t @@ -406,7 +406,7 @@ subtest 'Get shelves' => sub { subtest 'Get shelves containing biblios' => sub { - plan tests => 9; + plan tests => 11; my $patron1 = $builder->build( { source => 'Borrower', } ); my $patron2 = $builder->build( { source => 'Borrower', } ); my $biblio1 = $builder->build( { source => 'Biblio', } ); @@ -489,6 +489,12 @@ subtest 'Get shelves containing biblios' => sub { is ( $shelves_with_biblio4_for_patron2->count, 2, 'Patron should shown private and public lists for a given biblio' ); is ( $shelves_with_biblio4_for_patron2->next->shelfname, $shelf3->shelfname, 'The shelves should be sorted by shelfname' ); + # Test list_biblionumbers + my $biblios = $shelf2->list_biblionumbers; + is( @$biblios, 3, 'Three biblionumbers expected' ); + my @filtered = grep { $_ eq $biblio2->{biblionumber}; } @$biblios; + is( @filtered, 1, 'Biblio2 included' ); + teardown(); }; -- 2.1.4