Lines 529-535
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
529 |
$module->unmock('userenv'); |
529 |
$module->unmock('userenv'); |
530 |
}; |
530 |
}; |
531 |
|
531 |
|
532 |
subtest 'get_routinglists' => sub { |
532 |
subtest 'get_routing_lists' => sub { |
533 |
plan tests => 5; |
533 |
plan tests => 5; |
534 |
|
534 |
|
535 |
my $biblio = Koha::Biblio->new()->store(); |
535 |
my $biblio = Koha::Biblio->new()->store(); |
Lines 541-547
subtest 'get_routinglists' => sub {
Link Here
|
541 |
my $patron = $builder->build( { source => 'Borrower' } ); |
541 |
my $patron = $builder->build( { source => 'Borrower' } ); |
542 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
542 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
543 |
|
543 |
|
544 |
is( $patron->get_routinglists, 0, 'Retrieves correct number of routing lists: 0' ); |
544 |
is( $patron->get_routing_lists->count, 0, 'Retrieves correct number of routing lists: 0' ); |
545 |
|
545 |
|
546 |
my $routinglist_count = Koha::Subscription::Routinglists->count; |
546 |
my $routinglist_count = Koha::Subscription::Routinglists->count; |
547 |
my $routinglist = Koha::Subscription::Routinglist->new({ |
547 |
my $routinglist = Koha::Subscription::Routinglist->new({ |
Lines 550-560
subtest 'get_routinglists' => sub {
Link Here
|
550 |
subscriptionid => $subscription->subscriptionid |
550 |
subscriptionid => $subscription->subscriptionid |
551 |
})->store; |
551 |
})->store; |
552 |
|
552 |
|
553 |
is ($patron->get_routinglists, 1, "Retrieves correct number of routing lists: 1"); |
553 |
is ($patron->get_routing_lists->count, 1, "Retrieves correct number of routing lists: 1"); |
554 |
|
554 |
|
555 |
my @routinglists = $patron->get_routinglists; |
555 |
my @routinglists = $patron->get_routing_lists; |
556 |
is ($routinglists[0]->ranking, 5, "Retrieves ranking: 5"); |
556 |
is ($routinglists[0]->ranking, 5, "Retrieves ranking: 5"); |
557 |
is( ref($routinglists[0]), 'Koha::Subscription::Routinglist', 'get_routinglists returns Koha::Subscription::Routinglist objects' ); |
557 |
is( ref($routinglists[0]), 'Koha::Subscription::Routinglist', 'get_routing_lists returns Koha::Subscription::Routinglist objects' ); |
558 |
|
558 |
|
559 |
my $subscription2 = Koha::Subscription->new({ |
559 |
my $subscription2 = Koha::Subscription->new({ |
560 |
biblionumber => $biblio->biblionumber, |
560 |
biblionumber => $biblio->biblionumber, |
Lines 566-572
subtest 'get_routinglists' => sub {
Link Here
|
566 |
subscriptionid => $subscription2->subscriptionid |
566 |
subscriptionid => $subscription2->subscriptionid |
567 |
})->store; |
567 |
})->store; |
568 |
|
568 |
|
569 |
is ($patron->get_routinglists, 2, "Retrieves correct number of routing lists: 2"); |
569 |
is ($patron->get_routing_lists->count, 2, "Retrieves correct number of routing lists: 2"); |
570 |
|
570 |
|
571 |
$patron->delete; # Clean up for later tests |
571 |
$patron->delete; # Clean up for later tests |
572 |
|
572 |
|
573 |
- |
|
|