Bug 17574: Remove itemtype-related warnings from LocalHoldsPriority.t
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 7 Nov 2016 18:31:53 +0000 (15:31 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Sat, 12 Nov 2016 02:35:35 +0000 (02:35 +0000)
To test:
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> FAIL: Tests raise lots of warnings
- Apply the patch
- Run:
  $ prove t/db_dependent/Holds/LocalHoldsPriority.t
=> SUCCESS: Tests pass, and no warnings!
- Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Holds/LocalHoldsPriority.t

index 7ccc843..ef40686 100755 (executable)
@@ -25,26 +25,31 @@ $schema->storage->txn_begin;
 
 my $builder = t::lib::TestBuilder->new;
 
-my $library1 = $builder->build({
-    source => 'Branch',
-});
-my $library2 = $builder->build({
-    source => 'Branch',
-});
-my $library3 = $builder->build({
-    source => 'Branch',
-});
-my $library4 = $builder->build({
-    source => 'Branch',
-});
+my $library1 = $builder->build({ source => 'Branch', });
+my $library2 = $builder->build({ source => 'Branch', });
+my $library3 = $builder->build({ source => 'Branch', });
+my $library4 = $builder->build({ source => 'Branch', });
+my $itemtype = $builder->build(
+    {   source => 'Itemtype',
+        value  => { notforloan => undef, rentalcharge => 0 }
+    }
+)->{itemtype};
+
+
 
 my $borrowers_count = 5;
 
 # Create a helper biblio
 my ( $bibnum, $title, $bibitemnum ) = create_helper_biblio();
 # Create a helper item for the biblio.
-my ( $item_bibnum, $item_bibitemnum, $itemnumber ) =
-  AddItem( { homebranch => $library4->{branchcode}, holdingbranch => $library3->{branchcode} }, $bibnum );
+my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem(
+    {   homebranch    => $library4->{branchcode},
+        holdingbranch => $library3->{branchcode},
+        itype         => $itemtype
+    },
+    $bibnum
+);
+
 
 my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode}, $library4->{branchcode}, $library3->{branchcode}, $library4->{branchcode} );