use Koha::DateUtils;
use t::lib::TestBuilder;
-use Test::More tests => 31;
+use Test::More tests => 33;
use Test::Warn;
use_ok('Koha::Hold');
$dt->truncate( to => 'day' );
is( $hold->suspend, 1, "Hold is suspended" );
is( $hold->suspend_until, "$dt", "Hold is suspended with a date, truncation takes place automatically" );
+$hold->suspend_hold;
+is( $hold->suspend, 1, "Hold is suspended" );
+is( $hold->suspend_until, undef, "Hold is suspended without a date" );
$hold->resume();
is( $hold->suspend, 0, "Hold is not suspended" );
is( $hold->suspend_until, undef, "Hold no longer has suspend_until date" );
is( $hold->is_found, 0, 'The hold is not found' );
ok( !$hold->is_in_transit, 'The hold is not in transit' );
-# Test method is_cancelable
+# Test method is_cancelable_from_opac
$hold->found(undef);
-ok( $hold->is_cancelable(), "Unfound hold is cancelable" );
+is( $hold->is_cancelable_from_opac, 1, "Unfound hold is cancelable" );
$hold->found('W');
-ok( $hold->is_cancelable, "Waiting hold is cancelable" );
+is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" );
$hold->found('T');
-ok( !$hold->is_cancelable, "In transit hold is not cancelable" );
+is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" );
# Test method is_at_destination
$hold->found(undef);