Bugzilla – Attachment 86066 Details for
Bug 22455
Add Koha::Biblio::hidden_in_opac method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22455: Unit tests
Bug-22455-Unit-tests.patch (text/plain), 1.93 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-03-05 14:05:01 UTC
(
hide
)
Description:
Bug 22455: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-03-05 14:05:01 UTC
Size:
1.93 KB
patch
obsolete
>From b5052f010bd2947e95a517a74c80ffb86346b31b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 5 Mar 2019 11:00:31 -0300 >Subject: [PATCH] Bug 22455: Unit tests > >--- > t/db_dependent/Koha/Biblio.t | 35 +++++++++++++++++++++++++++++++++-- > 1 file changed, 33 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 281ad652ce..72c06e04f9 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,9 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 4; >+ >+use t::lib::TestBuilder; > > use C4::Biblio; > use Koha::Database; >@@ -27,7 +29,8 @@ BEGIN { > use_ok('Koha::Biblios'); > } > >-my $schema = Koha::Database->new->schema; >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; > > subtest 'metadata() tests' => sub { > >@@ -55,3 +58,31 @@ subtest 'metadata() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'hidden_in_opac() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ >+ $item_1->withdrawn( 1 )->store->discard_changes; >+ $item_2->withdrawn( 1 )->store->discard_changes; >+ >+ ok( !$biblio->hidden_in_opac({ rules => { withdrawn => [ 2 ] } }), 'Biblio not hidden' ); >+ >+ $item_2->withdrawn( 2 )->store->discard_changes; >+ $biblio->discard_changes; # refresh >+ >+ ok( !$biblio->hidden_in_opac({ rules => { withdrawn => [ 2 ] } }), 'Biblio not hidden' ); >+ >+ $item_1->withdrawn( 2 )->store->discard_changes; >+ $biblio->discard_changes; # refresh >+ >+ ok( $biblio->hidden_in_opac({ rules => { withdrawn => [ 2 ] } }), 'Biblio hidden' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.21.0
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 22455
:
86066
|
86067
|
86502
|
86503
|
86511
|
86512