Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 30; |
20 |
use Test::More tests => 31; |
21 |
use Test::Exception; |
21 |
use Test::Exception; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
|
23 |
|
Lines 486-491
subtest 'to_api() tests' => sub {
Link Here
|
486 |
$schema->storage->txn_rollback; |
486 |
$schema->storage->txn_rollback; |
487 |
}; |
487 |
}; |
488 |
|
488 |
|
|
|
489 |
subtest 'bookings() tests' => sub { |
490 |
|
491 |
plan tests => 3; |
492 |
|
493 |
$schema->storage->txn_begin; |
494 |
|
495 |
my $biblio = $builder->build_sample_biblio(); |
496 |
|
497 |
is( ref( $biblio->bookings ), 'Koha::Bookings', 'Return type is correct' ); |
498 |
|
499 |
is_deeply( |
500 |
$biblio->bookings->unblessed, |
501 |
[], |
502 |
'->bookings returns an empty Koha::Bookings resultset' |
503 |
); |
504 |
|
505 |
my $booking = $builder->build_object( |
506 |
{ |
507 |
class => 'Koha::Bookings', |
508 |
value => { biblio_id => $biblio->biblionumber } |
509 |
} |
510 |
); |
511 |
|
512 |
my $bookings = $biblio->bookings->unblessed; |
513 |
|
514 |
is_deeply( |
515 |
$biblio->bookings->unblessed, |
516 |
[ $booking->unblessed ], |
517 |
'->bookings returns the related Koha::Booking objects' |
518 |
); |
519 |
|
520 |
$schema->storage->txn_rollback; |
521 |
}; |
522 |
|
489 |
subtest 'suggestions() tests' => sub { |
523 |
subtest 'suggestions() tests' => sub { |
490 |
|
524 |
|
491 |
plan tests => 3; |
525 |
plan tests => 3; |
492 |
- |
|
|