Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 3; |
22 |
use Test::More tests => 4; |
23 |
|
23 |
|
24 |
use Koha::Authority::Types; |
24 |
use Koha::Authority::Types; |
25 |
use Koha::Cities; |
25 |
use Koha::Cities; |
Lines 51-55
subtest 'update' => sub {
Link Here
|
51 |
is( Koha::Cities->search( { city_country => 'UK' } )->count, 0, 'Koha::Objects->update should have updated the 3 rows' ); |
51 |
is( Koha::Cities->search( { city_country => 'UK' } )->count, 0, 'Koha::Objects->update should have updated the 3 rows' ); |
52 |
}; |
52 |
}; |
53 |
|
53 |
|
|
|
54 |
subtest 'search_related' => sub { |
55 |
plan tests => 3; |
56 |
my $builder = t::lib::TestBuilder->new; |
57 |
my $patron_1 = $builder->build( { source => 'Borrower' } ); |
58 |
my $patron_2 = $builder->build( { source => 'Borrower' } ); |
59 |
my $libraries = Koha::Patrons->search( { -or => { borrowernumber => [ $patron_1->{borrowernumber}, $patron_2->{borrowernumber} ] } } )->search_related('branchcode'); |
60 |
is( $libraries->count, 2, 'Koha::Objects->search_related should work as expected' ); |
61 |
is( $libraries->next->branchcode, $patron_1->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
62 |
is( $libraries->next->branchcode, $patron_2->{branchcode}, 'Koha::Objects->search_related should work as expected' ); |
63 |
}; |
64 |
|
54 |
$schema->storage->txn_rollback; |
65 |
$schema->storage->txn_rollback; |
55 |
1; |
66 |
1; |
56 |
- |
|
|