Bug 5144: Add test on carp message
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Oct 2015 12:54:22 +0000 (13:54 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 6 Oct 2015 13:02:06 +0000 (10:02 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Reserves.t

index 4e6fd6f..7301757 100755 (executable)
@@ -17,7 +17,8 @@
 
 use Modern::Perl;
 
-use Test::More tests => 72;
+use Test::More tests => 73;
+use Test::Warn;
 
 use MARC::Record;
 use DateTime::Duration;
@@ -444,9 +445,11 @@ is($p, 3, 'CalculatePriority should now return priority 3');
 # End of tests for bug 8918
 
 # Test for bug 5144
-$reserve_id = AddReserve('CPL',  $requesters{'CPL3'}, $bibnum,
+warning_is {
+    $reserve_id = AddReserve('CPL',  $requesters{'CPL3'}, $bibnum,
            $bibitems,  $p, output_pref($resdate), $expdate, $notes,
-           $title,      $checkitem, $found);
+           $title,      $checkitem, $found)
+} "AddReserve: borrower $requesters{CPL3} already has a hold for biblionumber $bibnum";
 is( $reserve_id, undef, 'Attempt to add a second reserve on a given record for the same patron fails.' );
 
 # Tests for cancel reserves by users from OPAC.