Lines 196-206
subtest 'filter_by_obsolete and cancel' => sub {
Link Here
|
196 |
$rs = Koha::Acquisition::Orders->filter_by_obsolete->search($limit); |
196 |
$rs = Koha::Acquisition::Orders->filter_by_obsolete->search($limit); |
197 |
is( $rs->count, 3, 'Three obsolete' ); |
197 |
is( $rs->count, 3, 'Three obsolete' ); |
198 |
my @results = $rs->cancel; |
198 |
my @results = $rs->cancel; |
199 |
is( $results[0], 3, 'All should be cancelled' ); |
199 |
is( $results[0], 2, 'Two should be cancelled, one was cancelled already' ); |
200 |
is( @{ $results[1] }, 0, 'No messages' ); |
200 |
is( @{ $results[1] }, 0, 'No messages' ); |
201 |
is( $order_1->discard_changes->orderstatus, 'cancelled', 'Check orderstatus of order_1' ); |
201 |
is( $order_1->discard_changes->orderstatus, 'cancelled', 'Check orderstatus of order_1' ); |
202 |
isnt( $order_2->discard_changes->datecancellationprinted, undef, 'Cancellation date of order_2 filled' ); |
202 |
isnt( $order_2->discard_changes->datecancellationprinted, undef, 'Cancellation date of order_2 filled' ); |
203 |
isnt( $order_3->discard_changes->datecancellationprinted, undef, 'Cancellation date of order_3 filled' ); |
203 |
is( $order_3->discard_changes->datecancellationprinted, undef, 'order_3 was skipped, so date not touched' ); |
204 |
|
204 |
|
205 |
$schema->storage->txn_rollback; |
205 |
$schema->storage->txn_rollback; |
206 |
}; |
206 |
}; |
207 |
- |
|
|