Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 10; |
22 |
use Test::More tests => 11; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use Koha::Authority::Types; |
25 |
use Koha::Authority::Types; |
Lines 116-121
subtest 'search_related' => sub {
Link Here
|
116 |
is( $libraries[1]->branchcode, $patron_2->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
116 |
is( $libraries[1]->branchcode, $patron_2->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
117 |
}; |
117 |
}; |
118 |
|
118 |
|
|
|
119 |
subtest 'single' => sub { |
120 |
plan tests => 2; |
121 |
my $builder = t::lib::TestBuilder->new; |
122 |
my $patron_1 = $builder->build( { source => 'Borrower' } ); |
123 |
my $patron_2 = $builder->build( { source => 'Borrower' } ); |
124 |
my $patron = Koha::Patrons->search({}, { rows => 1 })->single; |
125 |
is(ref($patron), 'Koha::Patron', 'Koha::Objects->single returns a single Koha::Patron object.'); |
126 |
warning_like { Koha::Patrons->search->single } qr/SQL that returns multiple rows/, |
127 |
"Warning is presented if single is used for a result with multiple rows."; |
128 |
}; |
129 |
|
119 |
subtest 'Exceptions' => sub { |
130 |
subtest 'Exceptions' => sub { |
120 |
plan tests => 2; |
131 |
plan tests => 2; |
121 |
|
132 |
|
122 |
- |
|
|