Lines 112-118
subtest 'all() tests' => sub {
Link Here
|
112 |
|
112 |
|
113 |
subtest 'pickup_locations() tests' => sub { |
113 |
subtest 'pickup_locations() tests' => sub { |
114 |
|
114 |
|
115 |
plan tests => 8; |
115 |
plan tests => 9; |
116 |
|
116 |
|
117 |
$schema->storage->txn_begin; |
117 |
$schema->storage->txn_begin; |
118 |
|
118 |
|
Lines 168-173
subtest 'pickup_locations() tests' => sub {
Link Here
|
168 |
is( scalar @{$pickup_locations}, 1, 'Only the library returned by $biblio->pickup_locations is returned' ); |
168 |
is( scalar @{$pickup_locations}, 1, 'Only the library returned by $biblio->pickup_locations is returned' ); |
169 |
is( $pickup_locations->[0]->{branchcode}, $library_2->branchcode, 'Not cheating' ); |
169 |
is( $pickup_locations->[0]->{branchcode}, $library_2->branchcode, 'Not cheating' ); |
170 |
|
170 |
|
|
|
171 |
subtest 'Koha::Item->pickup_locations and Koha::Biblio->pickup_locations empty tests' => sub { |
172 |
|
173 |
plan tests => 2; |
174 |
|
175 |
my $biblio_class = Test::MockModule->new('Koha::Biblio'); |
176 |
$biblio_class->mock( 'pickup_locations', sub { return Koha::Libraries->new->empty } ); |
177 |
|
178 |
my $biblio = $builder->build_sample_biblio; |
179 |
|
180 |
my @pickup_locations = @{$plugin->pickup_locations({ search_params => { biblio => $biblio->id } })}; |
181 |
is( scalar @pickup_locations, 0, 'No pickup locations returned' ); |
182 |
|
183 |
my $item_class = Test::MockModule->new('Koha::Item'); |
184 |
$item_class->mock( 'pickup_locations', sub { return Koha::Libraries->new->empty } ); |
185 |
|
186 |
my $item = $builder->build_sample_item; |
187 |
|
188 |
@pickup_locations = @{$plugin->pickup_locations({ search_params => { item => $item->id } })}; |
189 |
is( scalar @pickup_locations, 0, 'No pickup locations returned' ); |
190 |
}; |
191 |
|
171 |
subtest 'selected tests' => sub { |
192 |
subtest 'selected tests' => sub { |
172 |
|
193 |
|
173 |
plan tests => 4; |
194 |
plan tests => 4; |
174 |
- |
|
|