Bug 16717: Remove hardcoded category from Holds.t
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 27 May 2016 11:48:10 +0000 (13:48 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Jun 2016 14:45:35 +0000 (14:45 +0000)
There is actually no need to use the hardcoded patron category S in
this test.

Test plan:
Run t/db_dependent/Holds.t.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test passes OK
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Holds.t

index 7e490e3..b368481 100755 (executable)
@@ -34,11 +34,7 @@ my $dbh     = C4::Context->dbh;
 my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode };
 my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
 
-# This test assumes we have a category S. This statement helps.
-$builder->build({
-    source => 'Category',
-    value  => { categorycode => 'S', category_type => 'S' },
-});
+my $category = $builder->build({ source => 'Category' })->{categorycode};
 
 my $borrowers_count = 5;
 
@@ -64,7 +60,7 @@ foreach (1..$borrowers_count) {
     my $borrowernumber = AddMember(
         firstname =>  'my firstname',
         surname => 'my surname ' . $_,
-        categorycode => 'S',
+        categorycode => $category,
         branchcode => $branch_1,
     );
     push @borrowernumbers, $borrowernumber;