Bugzilla – Attachment 83669 Details for
Bug 10676
OpacHiddenItems not working for restricted on OPAC detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10676: Add unit tests - GetItemsInfo
Bug-10676-Add-unit-tests---GetItemsInfo.patch (text/plain), 2.79 KB, created by
Pierre-Marc Thibault
on 2019-01-04 21:59:19 UTC
(
hide
)
Description:
Bug 10676: Add unit tests - GetItemsInfo
Filename:
MIME Type:
Creator:
Pierre-Marc Thibault
Created:
2019-01-04 21:59:19 UTC
Size:
2.79 KB
patch
obsolete
>From b0d50ac91c4cac69945dc27ab0d6048451bf51fb Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 4 Jan 2019 11:42:08 +0000 >Subject: [PATCH] Bug 10676: Add unit tests - GetItemsInfo > >To test: > prove t/db_dependent/Items.t > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> > >https://bugs.koha-community.org/show_bug.cgi?id=22053 >--- > t/db_dependent/Items.t | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index bc7aaa9..154b2c6 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -29,6 +29,7 @@ use Koha::Library; > use Koha::DateUtils; > use Koha::MarcSubfieldStructures; > use Koha::Caches; >+use Koha::AuthorisedValues; > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -250,7 +251,7 @@ subtest 'GetHiddenItemnumbers tests' => sub { > > subtest 'GetItemsInfo tests' => sub { > >- plan tests => 4; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -265,6 +266,16 @@ subtest 'GetItemsInfo tests' => sub { > source => 'Itemtype', > }); > >+ Koha::AuthorisedValues->delete; >+ my $av1 = Koha::AuthorisedValue->new( >+ { >+ category => 'RESTRICTED', >+ authorised_value => '1', >+ lib => 'Restricted Access', >+ lib_opac => 'Restricted Access OPAC', >+ } >+ )->store(); >+ > # Add a biblio > my ($biblionumber, $biblioitemnumber) = get_biblio(); > # Add an item >@@ -273,6 +284,7 @@ subtest 'GetItemsInfo tests' => sub { > homebranch => $library1->{branchcode}, > holdingbranch => $library2->{branchcode}, > itype => $itemtype->{itemtype}, >+ restricted => 1, > }, > $biblionumber > ); >@@ -287,12 +299,19 @@ subtest 'GetItemsInfo tests' => sub { > > my @results = GetItemsInfo( $biblionumber ); > ok( @results, 'GetItemsInfo returns results'); >+ > is( $results[0]->{ home_branch_opac_info }, "homebranch OPAC info", > 'GetItemsInfo returns the correct home branch OPAC info notice' ); > is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info", > 'GetItemsInfo returns the correct holding branch OPAC info notice' ); > is( exists( $results[0]->{ onsite_checkout } ), 1, > 'GetItemsInfo returns a onsite_checkout key' ); >+ is( $results[0]->{ restricted }, 1, >+ 'GetItemsInfo returns a restricted value code' ); >+ is( $results[0]->{ restrictedvalue }, "Restricted Access", >+ 'GetItemsInfo returns a restricted value description (staff)' ); >+ is( $results[0]->{ restrictedvalueopac }, "Restricted Access OPAC", >+ 'GetItemsInfo returns a restricted value description (OPAC)' ); > > $schema->storage->txn_rollback; > }; >-- >2.7.4
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 10676
:
83630
|
83631
|
83668
|
83669
|
83670
|
83671
|
85122
|
85123