Bug 19350: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 Oct 2017 15:15:30 +0000 (12:15 -0300)
committerKatrin Fischer <katrin.fischer.83@web.de>
Wed, 18 Oct 2017 21:04:52 +0000 (23:04 +0200)
(cherry picked from commit a2cc68e8b7a33dd7983c2125e32ba269777b8ace)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ba051fd6eb54bbc3abf94d8f60b5543009cb32c)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

t/db_dependent/Items.t

index f85d48a..8a85fa4 100755 (executable)
@@ -26,7 +26,7 @@ use Koha::Library;
 use t::lib::Mocks;
 use t::lib::TestBuilder;
 
-use Test::More tests => 11;
+use Test::More tests => 12;
 
 use Test::Warn;
 
@@ -782,6 +782,21 @@ subtest '_mod_item_dates' => sub {
         'yetanotherdatetime is ok' );
 };
 
+subtest 'get_hostitemnumbers_of' => sub {
+    plan tests => 1;
+
+    my $bib = MARC::Record->new();
+    $bib->append_fields(
+        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
+        MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'),
+        MARC::Field->new('773', ' ', ' ', b => 'b without 0 or 9'),
+    );
+    my ($biblionumber, $bibitemnum) = AddBiblio($bib, '');
+
+    my @itemnumbers = C4::Items::get_hostitemnumbers_of( $biblionumber );
+    is( @itemnumbers, 0, );
+};
+
 # Helper method to set up a Biblio.
 sub get_biblio {
     my ( $frameworkcode ) = @_;