From 4fb3bb222b2c8a5913d7aff3d4db1be5a1690070 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 1 Mar 2017 01:29:42 +0000 Subject: [PATCH] Bug 14576 (QA Followup) Fix issue.t --- t/db_dependent/Circulation/issue.t | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t index 519340d..d471d42 100644 --- a/t/db_dependent/Circulation/issue.t +++ b/t/db_dependent/Circulation/issue.t @@ -17,7 +17,6 @@ use Modern::Perl; -use Test::More tests => 33; use DateTime::Duration; use t::lib::Mocks; @@ -33,7 +32,7 @@ use Koha::Database; use Koha::DateUtils; use Koha::Library; -use Test::More tests => 44; +use Test::More tests => 45; BEGIN { require_ok('C4::Circulation'); @@ -370,29 +369,29 @@ my $itemnumber2; { barcode => 'barcode_4', itemcallnumber => 'callnumber4', - homebranch => $samplebranch1->{branchcode}, - holdingbranch => $samplebranch1->{branchcode}, + homebranch => $branchcode_1, + holdingbranch => $branchcode_1, location => 'FIC', }, $biblionumber ); t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', q{} ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); my $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'FIC', 'UpdateItemLocationOnCheckin does not modify value when not enabled' ); t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', 'FIC: GEN' ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin updates location value from 'FIC' to 'GEN' with setting "FIC: GEN"} ); ok( $item2->{permanent_location} eq 'GEN', q{UpdateItemLocationOnCheckin updates permanent_location value from 'FIC' to 'GEN' with setting "FIC: GEN"} ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update location value from 'GEN' with setting "FIC: GEN"} ); t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', '_ALL_: CART' ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'CART', q{UpdateItemLocationOnCheckin updates location value from 'GEN' with setting "_ALL_: CART"} ); ok( $item2->{permanent_location} eq 'GEN', q{UpdateItemLocationOnCheckin does not update permanent_location value from 'GEN' with setting "_ALL_: CART"} ); @@ -401,14 +400,14 @@ $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'GEN', q{Location updates from 'CART' to permanent location on issue} ); t::lib::Mocks::mock_preference( 'UpdateItemLocationOnCheckin', "GEN: _BLANK_\n_BLANK_: PROC\nPROC: _PERM_" ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq '', q{UpdateItemLocationOnCheckin updates location value from 'GEN' to '' with setting "GEN: _BLANK_"} ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq 'PROC' , q{UpdateItemLocationOnCheckin updates location value from '' to 'PROC' with setting "_BLANK_: PROC"} ); ok( $item2->{permanent_location} eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location value from '' to 'PROC' with setting "_BLANK_: PROC"} ); -AddReturn( 'barcode_4', $samplebranch1->{branchcode} ); +AddReturn( 'barcode_4', $branchcode_1 ); $item2 = GetItem( $itemnumber2 ); ok( $item2->{location} eq '' , q{UpdateItemLocationOnCheckin updates location value from 'PROC' to '' with setting "PROC: _PERM_" } ); ok( $item2->{permanent_location} eq '' , q{UpdateItemLocationOnCheckin does not update permanent_location from '' with setting "PROC: _PERM_" } ); -- 2.1.4