Lines 119-132
my $branchcode2 = $builder->build({ source => 'Branch' })->{branchcode};
Link Here
|
119 |
|
119 |
|
120 |
$av1->add_library_limit( $branchcode1 ); |
120 |
$av1->add_library_limit( $branchcode1 ); |
121 |
|
121 |
|
122 |
@authorised_values = Koha::AuthorisedValues->new()->search( { category => 'av_for_testing', branchcode => $branchcode1 } ); |
122 |
@authorised_values = Koha::AuthorisedValues->search_with_library_limits( { category => 'av_for_testing' }, {}, $branchcode1 ); |
123 |
is( @authorised_values, 3, "Search including value with a branch limit ( branch can use the limited value ) gives correct number of results" ); |
123 |
is( @authorised_values, 3, "Search including value with a branch limit ( branch can use the limited value ) gives correct number of results" ); |
124 |
|
124 |
|
125 |
@authorised_values = Koha::AuthorisedValues->new()->search( { category => 'av_for_testing', branchcode => $branchcode2 } ); |
125 |
@authorised_values = Koha::AuthorisedValues->search_with_library_limits( { category => 'av_for_testing' }, {}, $branchcode2 ); |
126 |
is( @authorised_values, 2, "Search including value with a branch limit ( branch *cannot* use the limited value ) gives correct number of results" ); |
126 |
is( @authorised_values, 2, "Search including value with a branch limit ( branch *cannot* use the limited value ) gives correct number of results" ); |
127 |
|
127 |
|
128 |
$av1->del_library_limit( $branchcode1 ); |
128 |
$av1->del_library_limit( $branchcode1 ); |
129 |
@authorised_values = Koha::AuthorisedValues->new()->search( { category => 'av_for_testing', branchcode => $branchcode2 } ); |
129 |
@authorised_values = Koha::AuthorisedValues->search_with_library_limits( { category => 'av_for_testing' }, {}, $branchcode2 ); |
130 |
is( @authorised_values, 3, "Branch limitation deleted successfully" ); |
130 |
is( @authorised_values, 3, "Branch limitation deleted successfully" ); |
131 |
|
131 |
|
132 |
$av1->add_library_limit( $branchcode1 ); |
132 |
$av1->add_library_limit( $branchcode1 ); |
133 |
- |
|
|