|
Lines 221-230
subtest 'suggestions' => sub {
Link Here
|
| 221 |
); |
221 |
); |
| 222 |
|
222 |
|
| 223 |
my $order = Koha::Acquisition::Orders->find( $o->ordernumber ); |
223 |
my $order = Koha::Acquisition::Orders->find( $o->ordernumber ); |
| 224 |
is( ref( $order->suggestions ), 'Koha::Suggestions', |
224 |
is( |
| 225 |
'->suggestions should return a Koha::Suggestions object'); |
225 |
ref( $order->suggestions ), 'Koha::Suggestions', |
| 226 |
is( $order->suggestions->count, 0, |
226 |
'->suggestions should return a Koha::Suggestions object' |
| 227 |
'->suggestions should return empty set if no linked suggestion'); |
227 |
); |
|
|
228 |
is( |
| 229 |
$order->suggestions->count, 0, |
| 230 |
'->suggestions should return empty set if no linked suggestion' |
| 231 |
); |
| 228 |
|
232 |
|
| 229 |
$o = $builder->build_object( |
233 |
$o = $builder->build_object( |
| 230 |
{ |
234 |
{ |
|
Lines 239-248
subtest 'suggestions' => sub {
Link Here
|
| 239 |
); |
243 |
); |
| 240 |
|
244 |
|
| 241 |
$order = Koha::Acquisition::Orders->find( $o->ordernumber ); |
245 |
$order = Koha::Acquisition::Orders->find( $o->ordernumber ); |
| 242 |
is( ref( $order->suggestions ), 'Koha::Suggestions', |
246 |
is( |
| 243 |
'->suggestions should return a Koha::Suggestions object'); |
247 |
ref( $order->suggestions ), 'Koha::Suggestions', |
| 244 |
is( $order->suggestions->count, 1, |
248 |
'->suggestions should return a Koha::Suggestions object' |
| 245 |
'->suggestions should return linked suggestions'); |
249 |
); |
|
|
250 |
is( |
| 251 |
$order->suggestions->count, 1, |
| 252 |
'->suggestions should return linked suggestions' |
| 253 |
); |
| 246 |
|
254 |
|
| 247 |
$schema->storage->txn_rollback; |
255 |
$schema->storage->txn_rollback; |
| 248 |
}; |
256 |
}; |
|
Lines 957-967
subtest 'cancel() tests' => sub {
Link Here
|
| 957 |
{ |
965 |
{ |
| 958 |
class => 'Koha::Suggestions', |
966 |
class => 'Koha::Suggestions', |
| 959 |
value => { |
967 |
value => { |
| 960 |
biblionumber => $biblio_id, |
968 |
biblionumber => $biblio_id, |
| 961 |
suggesteddate => dt_from_string, |
969 |
suggesteddate => dt_from_string, |
| 962 |
STATUS => 'ORDERED', |
970 |
STATUS => 'ORDERED', |
| 963 |
archived => 0, |
971 |
archived => 0, |
| 964 |
ordernumber => $order->id, |
972 |
ordernumber => $order->id, |
| 965 |
} |
973 |
} |
| 966 |
} |
974 |
} |
| 967 |
); |
975 |
); |
| 968 |
- |
|
|