Lines 146-164
is( $messages_count, 3, "RETURN_RECALLED_ITEM notice successfully sent to checko
Link Here
|
146 |
my $message = Koha::Recalls->move_recall; |
146 |
my $message = Koha::Recalls->move_recall; |
147 |
is( $message, 'no recall_id provided', "Can't move a recall without specifying which recall" ); |
147 |
is( $message, 'no recall_id provided', "Can't move a recall without specifying which recall" ); |
148 |
|
148 |
|
149 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->id }); |
149 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id }); |
150 |
is( $message, 'no action provided', "No clear action to perform on recall" ); |
150 |
is( $message, 'no action provided', "No clear action to perform on recall" ); |
151 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'whatever' }); |
151 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'whatever' }); |
152 |
is( $message, 'no action provided', "Legal action not provided to perform on recall" ); |
152 |
is( $message, 'no action provided', "Legal action not provided to perform on recall" ); |
153 |
|
153 |
|
154 |
$recall->set_waiting({ item => $item1 }); |
154 |
$recall->set_waiting({ item => $item1 }); |
155 |
ok( $recall->waiting, "Recall is waiting" ); |
155 |
ok( $recall->waiting, "Recall is waiting" ); |
156 |
Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'revert' }); |
156 |
Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'revert' }); |
157 |
$recall = Koha::Recalls->find( $recall->id ); |
157 |
$recall = Koha::Recalls->find( $recall->recall_id ); |
158 |
ok( $recall->requested, "Recall reverted to requested with move_recall" ); |
158 |
ok( $recall->requested, "Recall reverted to requested with move_recall" ); |
159 |
|
159 |
|
160 |
Koha::Recalls->move_recall({ recall_id => $recall->id, action => 'cancel' }); |
160 |
Koha::Recalls->move_recall({ recall_id => $recall->recall_id, action => 'cancel' }); |
161 |
$recall = Koha::Recalls->find( $recall->id ); |
161 |
$recall = Koha::Recalls->find( $recall->recall_id ); |
162 |
ok( $recall->cancelled, "Recall cancelled with move_recall" ); |
162 |
ok( $recall->cancelled, "Recall cancelled with move_recall" ); |
163 |
|
163 |
|
164 |
( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({ |
164 |
( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({ |
Lines 169-176
ok( $recall->cancelled, "Recall cancelled with move_recall" );
Link Here
|
169 |
expirationdate => undef, |
169 |
expirationdate => undef, |
170 |
interface => 'COMMANDLINE', |
170 |
interface => 'COMMANDLINE', |
171 |
}); |
171 |
}); |
172 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->id, item => $item2, borrowernumber => $patron1->borrowernumber }); |
172 |
$message = Koha::Recalls->move_recall({ recall_id => $recall->recall_id, item => $item2, borrowernumber => $patron1->borrowernumber }); |
173 |
$recall = Koha::Recalls->find( $recall->id ); |
173 |
$recall = Koha::Recalls->find( $recall->recall_id ); |
174 |
ok( $recall->fulfilled, "Recall fulfilled with move_recall" ); |
174 |
ok( $recall->fulfilled, "Recall fulfilled with move_recall" ); |
175 |
|
175 |
|
176 |
$schema->storage->txn_rollback(); |
176 |
$schema->storage->txn_rollback(); |
Lines 191-197
subtest 'filter_by_current() and filter_by_finished() tests' => sub {
Link Here
|
191 |
|
191 |
|
192 |
my $recalls = Koha::Recalls->search( |
192 |
my $recalls = Koha::Recalls->search( |
193 |
{ |
193 |
{ |
194 |
id => [ |
194 |
recall_id => [ |
195 |
$in_transit->id, |
195 |
$in_transit->id, |
196 |
$overdue->id, |
196 |
$overdue->id, |
197 |
$requested->id, |
197 |
$requested->id, |
Lines 201-207
subtest 'filter_by_current() and filter_by_finished() tests' => sub {
Link Here
|
201 |
$fulfilled->id, |
201 |
$fulfilled->id, |
202 |
] |
202 |
] |
203 |
}, |
203 |
}, |
204 |
{ order_by => [ 'id' ] } |
204 |
{ order_by => [ 'recall_id' ] } |
205 |
); |
205 |
); |
206 |
|
206 |
|
207 |
is( $recalls->count, 7, 'Resultset count is correct' ); |
207 |
is( $recalls->count, 7, 'Resultset count is correct' ); |
208 |
- |
|
|