$self->found('T');
$self->store();
+ Koha::Plugins->call(
+ 'after_hold_action',
+ {
+ action => 'transfer',
+ payload => { hold => $self->get_from_storage }
+ }
+ );
+
return $self;
}
$self->set($values)->store();
+ Koha::Plugins->call(
+ 'after_hold_action',
+ {
+ action => 'waiting',
+ payload => { hold => $self->get_from_storage }
+ }
+ );
+
return $self;
}
$self->found('P');
$self->store();
+ Koha::Plugins->call(
+ 'after_hold_action',
+ {
+ action => 'processing',
+ payload => { hold => $self->get_from_storage }
+ }
+ );
+
return $self;
}
subtest 'Koha::Hold tests' => sub {
- plan tests => 4;
+ plan tests => 7;
$schema->storage->txn_begin;
'->resume calls the after_hold_action hook';
warning_like {
+ $hold->set_transfer;
+ }
+ qr/after_hold_action called with action: transfer, ref: Koha::Hold/,
+ '->set_transfer calls the after_hold_action hook';
+
+ warning_like {
+ $hold->set_processing;
+ }
+ qr/after_hold_action called with action: processing, ref: Koha::Hold/,
+ '->set_processing calls the after_hold_action hook';
+
+ warning_like {
+ $hold->set_waiting;
+ }
+ qr/after_hold_action called with action: waiting, ref: Koha::Hold/,
+ '->set_waiting calls the after_hold_action hook';
+
+ warning_like {
$hold->cancel;
}
qr/after_hold_action called with action: cancel, ref: Koha::Old::Hold/,