From d5f7024cf9780033a6f4d5d00d7149b1ba0a568e Mon Sep 17 00:00:00 2001 From: Indranil Das Gupta Date: Wed, 17 Jun 2015 10:21:50 +0530 Subject: [PATCH] (qa followup) variable declaration and cleanup 1/ running koha qa tools showed up valid FAIL. This patch fix that error. FAIL t/db_dependent/Reserves.t OK critic OK forbidden patterns OK pod FAIL valid "my" variable $title masks earlier declaration in same scope "my" variable $bibitemnum masks earlier declaration in same scope 2/ the following redundant line was removed as it had no use: t::lib::Mocks::mock_preference('maxreserves', 15); Signed-off-by: Alex Arnaud (Biblibre) http://bugs.koha-community.org/show_bug.cgi?id=14155 --- t/db_dependent/Reserves.t | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 635fdce..5a109d7 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -81,36 +81,38 @@ my ($bibnum, $bibitemnum); ($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); my $miniaturist = MARC::Record->new(); -my $title = 'The Miniaturist'; +my $title_14155a = 'The Miniaturist'; if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { $miniaturist->append_fields( MARC::Field->new('600', '', '1', a => 'Burton, Jessie'), - MARC::Field->new('200', '', '', a => $title), + MARC::Field->new('200', '', '', a => $title_14155a), ); } else { $miniaturist->append_fields( MARC::Field->new('100', '', '', a => 'Burton, Jessie'), - MARC::Field->new('245', '', '', a => $title), + MARC::Field->new('245', '', '', a => $title_14155a), ); } -my ($miniaturist_id, $title, $bibitemnum) = AddBiblio($miniaturist, ''); +my ($miniaturist_id, $bibitemnum_14155a); +($miniaturist_id, $title_14155a, $bibitemnum_14155a) = AddBiblio($miniaturist, ''); my $broken = MARC::Record->new(); -my $title = 'The broken'; +my $title_14155b = 'The broken'; if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { $broken->append_fields( MARC::Field->new('600', '', '1', a => 'Cohen, Tamar'), - MARC::Field->new('200', '', '', a => $title), + MARC::Field->new('200', '', '', a => $title_14155b), ); } else { $broken->append_fields( MARC::Field->new('100', '', '', a => 'Cohen, Tamar'), - MARC::Field->new('245', '', '', a => $title), + MARC::Field->new('245', '', '', a => $title_14155b), ); } -my ($broken_id, $title, $bibitemnum) = AddBiblio($broken, ''); +my ($broken_id, $bibitemnum_14155b); +($broken_id, $title_14155b, $bibitemnum_14155b) = AddBiblio($broken, ''); # Create a helper item instance for testing my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); @@ -167,16 +169,14 @@ ok(!ReachedMaxReserves($borrowernumber), 'First borrower doesn\'t reached max re AddReserve($branch, $borrowernumber, $miniaturist_id, $constraint, $bibitems, $priority, $resdate, $expdate, $notes, - $title, $checkitem, $found); + $title_14155a, $checkitem, $found); AddReserve($branch, $borrowernumber, $broken_id, $constraint, $bibitems, $priority, $resdate, $expdate, $notes, - $title, $checkitem, $found); + $title_14155b, $checkitem, $found); ok(ReachedMaxReserves($borrowernumber), 'First borrower reached max reserves'); -t::lib::Mocks::mock_preference('maxreserves', 15); - my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); C4::Context->set_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); ok( -- 1.7.10.4