|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 8; |
22 |
use Test::More tests => 9; |
| 23 |
use MARC::Field; |
23 |
use MARC::Field; |
| 24 |
use MARC::File::XML; |
24 |
use MARC::File::XML; |
| 25 |
use MARC::Record; |
25 |
use MARC::Record; |
|
Lines 285-288
subtest 'get_identifiers' => sub {
Link Here
|
| 285 |
); |
285 |
); |
| 286 |
}; |
286 |
}; |
| 287 |
|
287 |
|
|
|
288 |
subtest 'record tests' => sub { |
| 289 |
plan tests => 3; |
| 290 |
|
| 291 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
| 292 |
my $record = MARC::Record->new(); |
| 293 |
$record->add_fields( |
| 294 |
[ |
| 295 |
'100', ' ', ' ', |
| 296 |
a => 'Lastname, Firstname', |
| 297 |
b => 'b', |
| 298 |
c => 'c', |
| 299 |
i => 'i' |
| 300 |
], |
| 301 |
[ |
| 302 |
'024', '', '', |
| 303 |
a => '0000-0002-1234-5678', |
| 304 |
2 => 'orcid', |
| 305 |
6 => 'https://orcid.org/0000-0002-1234-5678' |
| 306 |
], |
| 307 |
[ |
| 308 |
'024', '', '', |
| 309 |
a => '01234567890', |
| 310 |
2 => 'scopus', |
| 311 |
6 => 'https://www.scopus.com/authid/detail.uri?authorId=01234567890' |
| 312 |
], |
| 313 |
); |
| 314 |
my $authid = C4::AuthoritiesMarc::AddAuthority($record, undef, 'PERSO_NAME'); |
| 315 |
my $authority = Koha::Authorities->find($authid); |
| 316 |
my $authority_record = $authority->record; |
| 317 |
is ($authority_record->field('100')->subfield('a'), 'Lastname, Firstname'); |
| 318 |
my @fields_024 = $authority_record->field('024'); |
| 319 |
is ($fields_024[0]->subfield('a'), '0000-0002-1234-5678'); |
| 320 |
is ($fields_024[1]->subfield('a'), '01234567890'); |
| 321 |
|
| 322 |
}; |
| 323 |
|
| 288 |
$schema->storage->txn_rollback; |
324 |
$schema->storage->txn_rollback; |
| 289 |
- |
|
|