Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use Koha::Authority::Types; |
25 |
use Koha::Authority::Types; |
Lines 81-85
subtest 'not_covered_yet' => sub {
Link Here
|
81 |
warning_is { Koha::Patrons->search->not_covered_yet } { carped => 'The method not_covered_yet is not covered by tests' }, "If a method is not covered by tests, the AUTOLOAD method won't execute the method"; |
81 |
warning_is { Koha::Patrons->search->not_covered_yet } { carped => 'The method not_covered_yet is not covered by tests' }, "If a method is not covered by tests, the AUTOLOAD method won't execute the method"; |
82 |
}; |
82 |
}; |
83 |
|
83 |
|
|
|
84 |
subtest 'search_related' => sub { |
85 |
plan tests => 3; |
86 |
my $builder = t::lib::TestBuilder->new; |
87 |
my $patron_1 = $builder->build( { source => 'Borrower' } ); |
88 |
my $patron_2 = $builder->build( { source => 'Borrower' } ); |
89 |
my $libraries = Koha::Patrons->search( { -or => { borrowernumber => [ $patron_1->{borrowernumber}, $patron_2->{borrowernumber} ] } } )->search_related('branchcode'); |
90 |
is( $libraries->count, 2, 'Koha::Objects->search_related should work as expected' ); |
91 |
is( $libraries->next->branchcode, $patron_1->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
92 |
is( $libraries->next->branchcode, $patron_2->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
93 |
}; |
94 |
|
84 |
$schema->storage->txn_rollback; |
95 |
$schema->storage->txn_rollback; |
85 |
1; |
96 |
1; |
86 |
- |
|
|