|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 13; |
22 |
use Test::More tests => 14; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
| 25 |
use Koha::Authority::Types; |
25 |
use Koha::Authority::Types; |
|
Lines 43-48
my @columns = Koha::Patrons->columns;
Link Here
|
| 43 |
my $borrowernumber_exists = grep { /^borrowernumber$/ } @columns; |
43 |
my $borrowernumber_exists = grep { /^borrowernumber$/ } @columns; |
| 44 |
is( $borrowernumber_exists, 1, 'Koha::Objects->columns should return the table columns' ); |
44 |
is( $borrowernumber_exists, 1, 'Koha::Objects->columns should return the table columns' ); |
| 45 |
|
45 |
|
|
|
46 |
subtest 'find' => sub { |
| 47 |
plan tests => 2; |
| 48 |
my $patron = $builder->build({source => 'Borrower'}); |
| 49 |
my $patron_object = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 50 |
is( $patron_object->borrowernumber, $patron->{borrowernumber}, '->find should return the correct object' ); |
| 51 |
|
| 52 |
eval { my @patrons = Koha::Patrons->find( $patron->{borrowernumber} ); }; |
| 53 |
like( $@, qr|^Cannot use "->find" in list context|, "->find should not be called in list context to avoid side-effects" ); |
| 54 |
}; |
| 55 |
|
| 46 |
subtest 'update' => sub { |
56 |
subtest 'update' => sub { |
| 47 |
plan tests => 2; |
57 |
plan tests => 2; |
| 48 |
|
58 |
|
| 49 |
- |
|
|