Before this patch, the suspend step triggers a warn from Koha::Hold.
Now we catch it.
Test plan:
Run the test. Do not see the warning about unable to suspend.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
NOTE: Nice clean up!
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
use Koha::DateUtils;
use t::lib::TestBuilder;
-use Test::More tests => 31;
+use Test::More tests => 32;
+use Test::Warn;
use_ok('Koha::Hold');
is( $hold->suspend, 0, "Hold is not suspended" );
is( $hold->suspend_until, undef, "Hold no longer has suspend_until date" );
$hold->found('W');
-$hold->suspend_hold();
+warning_like { $hold->suspend_hold }
+ qr/Unable to suspend waiting hold!/, 'Catch warn about failed suspend';
is( $hold->suspend, 0, "Waiting hold cannot be suspended" );
$item = $hold->item();