|
Lines 20-26
Link Here
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use FindBin; |
22 |
use FindBin; |
| 23 |
use Test::More tests => 4; |
23 |
use Test::More tests => 5; |
| 24 |
use Test::Warn; |
24 |
use Test::Warn; |
| 25 |
use t::lib::Mocks qw( mock_preference ); |
25 |
use t::lib::Mocks qw( mock_preference ); |
| 26 |
|
26 |
|
|
Lines 57-62
subtest '_add_rowdata' => sub {
Link Here
|
| 57 |
test_add_rowdata(); |
57 |
test_add_rowdata(); |
| 58 |
}; |
58 |
}; |
| 59 |
|
59 |
|
|
|
60 |
subtest ImportBreedingAuth => sub { |
| 61 |
plan tests => 4; |
| 62 |
|
| 63 |
my $record = MARC::Record->new(); |
| 64 |
$record->append_fields( |
| 65 |
MARC::Field->new('001', '4815162342'), |
| 66 |
MARC::Field->new('100', ' ', ' ', a => 'Jansson, Tove'), |
| 67 |
); |
| 68 |
|
| 69 |
my $breedingid = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); |
| 70 |
ok( $breedingid, "We got a breeding id back"); |
| 71 |
my $breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); |
| 72 |
is( $breedingid, $breedingid_1, "For the same record, we get the same id"); |
| 73 |
$breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"marcelr","UTF8"); |
| 74 |
is( $breedingid, $breedingid_1, "For the same record in a different file, we get a new id"); |
| 75 |
my $record_1 = MARC::Record->new(); |
| 76 |
$record_1->append_fields( |
| 77 |
MARC::Field->new('001', '8675309'), |
| 78 |
MARC::Field->new('100', ' ', ' ', a => 'Cooper, Susan'), |
| 79 |
); |
| 80 |
my $breedingid_2 = C4::Breeding::ImportBreedingAuth($record_1,"kidclamp","UTF8"); |
| 81 |
isnt( $breedingid, $breedingid_2, "For a new record, we get a new id"); |
| 82 |
}; |
| 83 |
|
| 60 |
#------------------------------------------------------------------------------- |
84 |
#------------------------------------------------------------------------------- |
| 61 |
|
85 |
|
| 62 |
sub test_build_translate_query { |
86 |
sub test_build_translate_query { |
| 63 |
- |
|
|