View | Details | Raw Unified | Return to bug 23281
Collapse All | Expand All

(-)a/Koha/Patron/Attribute/Types.pm (-1 / +1 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use Koha::Patron::Attribute::Type;
20
use Koha::Patron::Attribute::Type;
21
21
22
use base qw(Koha::Objects);
22
use base qw(Koha::Objects Koha::Objects::Limit::Library);
23
23
24
=head1 NAME
24
=head1 NAME
25
25
(-)a/t/db_dependent/Koha/Patron/Attribute/Types.t (-12 / +5 lines)
Lines 287-293 subtest 'replace_library_limits() tests' => sub { Link Here
287
    $schema->storage->txn_rollback;
287
    $schema->storage->txn_rollback;
288
};
288
};
289
289
290
subtest 'search() with branch limits tests' => sub {
290
subtest 'search_with_library_limits() tests' => sub {
291
291
292
    plan tests => 3;
292
    plan tests => 3;
293
293
Lines 322-337 subtest 'search() with branch limits tests' => sub { Link Here
322
    $object_code_2->library_limits( [$branch_2] );
322
    $object_code_2->library_limits( [$branch_2] );
323
    $object_code_3->library_limits( [ $branch_1, $branch_2 ] );
323
    $object_code_3->library_limits( [ $branch_1, $branch_2 ] );
324
324
325
    is( Koha::Patron::Attribute::Types->search( { branchcode => $branch_1 } )
325
    is( Koha::Patron::Attribute::Types->search_with_library_limits( {}, {}, $branch_1 )->count,
326
            ->count,
326
        3, '3 attribute types are available for the specified branch' );
327
        3,
327
    is( Koha::Patron::Attribute::Types->search_with_library_limits( {}, {}, $branch_2 )->count,
328
        '3 attribute types are available for the specified branch'
328
        3, '3 attribute types are available for the specified branch' );
329
    );
330
    is( Koha::Patron::Attribute::Types->search( { branchcode => $branch_2 } )
331
            ->count,
332
        3,
333
        '3 attribute types are available for the specified branch'
334
    );
335
329
336
    $schema->storage->txn_rollback;
330
    $schema->storage->txn_rollback;
337
};
331
};
338
- 

Return to bug 23281