|
Lines 22-27
use utf8;
Link Here
|
| 22 |
|
22 |
|
| 23 |
use Test::More tests => 15; |
23 |
use Test::More tests => 15; |
| 24 |
use Test::Exception; |
24 |
use Test::Exception; |
|
|
25 |
use Test::MockModule; |
| 25 |
|
26 |
|
| 26 |
use C4::Biblio qw( GetMarcSubfieldStructure ); |
27 |
use C4::Biblio qw( GetMarcSubfieldStructure ); |
| 27 |
use C4::Circulation qw( AddIssue AddReturn ); |
28 |
use C4::Circulation qw( AddIssue AddReturn ); |
|
Lines 1170-1176
subtest 'columns_to_str' => sub {
Link Here
|
| 1170 |
|
1171 |
|
| 1171 |
subtest 'store() tests' => sub { |
1172 |
subtest 'store() tests' => sub { |
| 1172 |
|
1173 |
|
| 1173 |
plan tests => 1; |
1174 |
plan tests => 2; |
| 1174 |
|
1175 |
|
| 1175 |
subtest '_set_found_trigger() tests' => sub { |
1176 |
subtest '_set_found_trigger() tests' => sub { |
| 1176 |
|
1177 |
|
|
Lines 1223-1228
subtest 'store() tests' => sub {
Link Here
|
| 1223 |
|
1224 |
|
| 1224 |
$schema->storage->txn_rollback; |
1225 |
$schema->storage->txn_rollback; |
| 1225 |
}; |
1226 |
}; |
|
|
1227 |
|
| 1228 |
subtest 'holds_queue update tests' => sub { |
| 1229 |
|
| 1230 |
plan tests => 2; |
| 1231 |
|
| 1232 |
$schema->storage->txn_begin; |
| 1233 |
|
| 1234 |
my $biblio = $builder->build_sample_biblio; |
| 1235 |
|
| 1236 |
my $mock = Test::MockModule->new('Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue'); |
| 1237 |
$mock->mock( 'enqueue', sub { |
| 1238 |
my ( $self, $args ) = @_; |
| 1239 |
is_deeply( |
| 1240 |
$args->{biblio_ids}, |
| 1241 |
[ $biblio->id ], |
| 1242 |
'->store triggers a holds queue update for the related biblio' |
| 1243 |
); |
| 1244 |
} ); |
| 1245 |
|
| 1246 |
# new item |
| 1247 |
my $item = $builder->build_sample_item({ biblionumber => $biblio->id }); |
| 1248 |
|
| 1249 |
# updated item |
| 1250 |
$item->set({ reserves => 1 })->store; |
| 1251 |
|
| 1252 |
$schema->storage->txn_rollback; |
| 1253 |
}; |
| 1226 |
}; |
1254 |
}; |
| 1227 |
|
1255 |
|
| 1228 |
subtest 'Recalls tests' => sub { |
1256 |
subtest 'Recalls tests' => sub { |
| 1229 |
- |
|
|