|
Lines 175-181
budget_code: 975$h'
Link Here
|
| 175 |
}; |
175 |
}; |
| 176 |
|
176 |
|
| 177 |
subtest 'add_biblio_from_import_record()' => sub { |
177 |
subtest 'add_biblio_from_import_record()' => sub { |
| 178 |
plan tests => 4; |
178 |
plan tests => 5; |
| 179 |
|
179 |
|
| 180 |
$schema->storage->txn_begin; |
180 |
$schema->storage->txn_begin; |
| 181 |
|
181 |
|
|
Lines 221-226
subtest 'add_biblio_from_import_record()' => sub {
Link Here
|
| 221 |
'A new biblionumber is added or an existing biblionumber is returned' |
221 |
'A new biblionumber is added or an existing biblionumber is returned' |
| 222 |
); |
222 |
); |
| 223 |
|
223 |
|
|
|
224 |
my $match_biblio = $builder->build_sample_biblio(); |
| 225 |
my $match_biblio_id = $match_biblio->biblionumber; |
| 226 |
$match_biblio->delete; |
| 227 |
my $match_record = MARC::Record->new(); |
| 228 |
$match_record->add_fields( |
| 229 |
[ '001', '1234' ], |
| 230 |
[ '020', ' ', ' ', a => '9780596004931' ], |
| 231 |
[ '975', ' ', ' ', p => 10, q => 1, h => 1 ], |
| 232 |
); |
| 233 |
|
| 234 |
my $match_import_record_id = C4::ImportBatch::AddBiblioToBatch( $import_batch_id, 0, $match_record, 'utf8', 0 ); |
| 235 |
my $match_import_record = Koha::Import::Records->find($match_import_record_id); |
| 236 |
my $import_record_match = Koha::Import::Record::Match->new( |
| 237 |
{ |
| 238 |
import_record_id => $match_import_record_id, |
| 239 |
candidate_match_id => $match_biblio_id, |
| 240 |
chosen => 1, |
| 241 |
} |
| 242 |
)->store; |
| 243 |
my $match_result = Koha::MarcOrder::add_biblio_from_import_record( |
| 244 |
{ |
| 245 |
import_record => $match_import_record, |
| 246 |
matcher_id => $sample_import_batch->{matcher_id}, |
| 247 |
overlay_action => 'replace', |
| 248 |
agent => 'interface', |
| 249 |
import_batch_id => $import_batch_id |
| 250 |
} |
| 251 |
); |
| 252 |
isnt( |
| 253 |
$match_result->{record_result}->{biblionumber}, $match_biblio_id, |
| 254 |
'A new biblionumber is added when the matched biblionumber does not exist' |
| 255 |
); |
| 256 |
|
| 224 |
# Check that records are skipped if not selected when called from addorderiso2709.pl |
257 |
# Check that records are skipped if not selected when called from addorderiso2709.pl |
| 225 |
# Pass in an empty array and the record should be skipped |
258 |
# Pass in an empty array and the record should be skipped |
| 226 |
my @import_record_id_selected = (); |
259 |
my @import_record_id_selected = (); |
| 227 |
- |
|
|