Bug 23225: Add a test
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 28 Jun 2019 19:00:53 +0000 (14:00 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 1 Jul 2019 13:45:52 +0000 (14:45 +0100)
Signed-off-by: Luis F. Lopez <lflfalagan@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/db_dependent/Koha/Biblio.t

index f123a31..7f04ca1 100644 (file)
@@ -62,11 +62,14 @@ subtest 'metadata() tests' => sub {
 
 subtest 'hidden_in_opac() tests' => sub {
 
-    plan tests => 3;
+    plan tests => 4;
 
     $schema->storage->txn_begin;
 
     my $biblio = $builder->build_sample_biblio();
+
+    ok( !$biblio->hidden_in_opac({ rules => { withdrawn => [ 2 ] } }), 'Biblio not hidden if there is no item attached' );
+
     my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
     my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });