Bug 20900: Add CPL test branch in rollingloans.t
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 8 Jun 2018 08:56:10 +0000 (10:56 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 30 Jul 2018 13:45:56 +0000 (15:45 +0200)
Trivial fix.

Test plan:
Without this patch and a CPL library, run rollingsloans.t. See warns.
With this patch, no warns.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7e3f399867abdf506ff271c57d652d1b3cdf8a7e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

t/db_dependent/rollingloans.t

index 75ec17f..84fb3be 100644 (file)
@@ -5,6 +5,7 @@ use C4::Circulation;
 use C4::Members;
 use C4::Items;
 use Koha::DateUtils;
+use Koha::Libraries;
 use Koha::Patrons;
 use t::lib::TestBuilder;
 
@@ -13,6 +14,10 @@ use Test::More tests => 8;
 my $schema = Koha::Database->new->schema;
 $schema->storage->txn_begin;
 
+my $builder = t::lib::TestBuilder->new;
+$builder->build({ source => 'Branch', value => { branchcode => 'CPL' } })
+    unless Koha::Libraries->find('CPL');
+
 C4::Context->_new_userenv(1234567);
 C4::Context->set_userenv(91, 'CLIstaff', '23529001223661', 'CPL',
                          'CPL', 'CPL', '', 'cc@cscnet.co.uk');
@@ -23,7 +28,6 @@ my $test_item_fic = '502326000402';
 my $test_item_24 = '502326000404';
 my $test_item_48 = '502326000403';
 
-my $builder = t::lib::TestBuilder->new;
 my $borrower1 = $builder->build_object({ class => 'Koha::Patrons', value => { cardnumber => $test_patron } });
 my $item1 = GetItem (undef,$test_item_fic);