Bugzilla – Attachment 140069 Details for
Bug 20058
Option to use shelving location instead of homebranch for sorting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20058: Add tests
Bug-20058-Add-tests.patch (text/plain), 2.74 KB, created by
Nick Clemens (kidclamp)
on 2022-09-02 07:01:27 UTC
(
hide
)
Description:
Bug 20058: Add tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-09-02 07:01:27 UTC
Size:
2.74 KB
patch
obsolete
>From 9e682486ad1a4c7328f93851354567ffc2f5327c Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Mon, 27 Sep 2021 16:48:25 +0200 >Subject: [PATCH] Bug 20058: Add tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/SIP/Message.t | 52 +++++++++++++++++++++++++++++++++++- > 1 file changed, 51 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index cf4e183a48..84aa2aac29 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -21,7 +21,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 13; >+use Test::More tests => 14; > use Test::Exception; > use Test::MockObject; > use Test::MockModule; >@@ -113,6 +113,56 @@ subtest 'Test hold_patron_bcode' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'UseLocationAsAQInSIP syspref tests' => sub { >+ plan tests => 2; >+ >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ >+ my $builder = t::lib::TestBuilder->new(); >+ >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my $branchcode_permanent_location = $builder->build({ source => 'Branch' })->{branchcode}; >+ >+ my $mocks = create_mocks( \$branchcode, \$branchcode_permanent_location ); >+ >+ t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 0); >+ >+ my $item = $builder->build_sample_item( >+ { >+ damaged => 0, >+ withdrawn => 0, >+ itemlost => 0, >+ restricted => 0, >+ homebranch => $branchcode, >+ holdingbranch => $branchcode, >+ permanent_location => $branchcode_permanent_location >+ } >+ ); >+ >+ my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); >+ is( $sip_item->permanent_location, $branchcode, "When UseLocationAsAQInSIP is not set SIP item has permanent_location set to value of homebranch" ); >+ >+ t::lib::Mocks::mock_preference('UseLocationAsAQInSIP', 1); >+ >+ $item = $builder->build_sample_item( >+ { >+ damaged => 0, >+ withdrawn => 0, >+ itemlost => 0, >+ restricted => 0, >+ homebranch => $branchcode, >+ holdingbranch => $branchcode, >+ permanent_location => $branchcode_permanent_location >+ } >+ ); >+ >+ $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); >+ is( $sip_item->permanent_location, $branchcode_permanent_location, "When UseLocationAsAQInSIP is set SIP item has permanent_location set to value of item permanent_location" ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'hold_patron_name() tests' => sub { > > plan tests => 3; >-- >2.30.2
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 20058
:
70791
|
125364
|
125365
|
125366
|
125454
|
125455
|
138925
|
138926
|
140068
| 140069 |
140070
|
140071