Lines 20-28
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 |
use t::lib::TestBuilder; |
27 |
|
26 |
|
28 |
|
27 |
use C4::Context; |
29 |
use C4::Context; |
28 |
use C4::Breeding; |
30 |
use C4::Breeding; |
Lines 57-62
subtest '_add_rowdata' => sub {
Link Here
|
57 |
test_add_rowdata(); |
59 |
test_add_rowdata(); |
58 |
}; |
60 |
}; |
59 |
|
61 |
|
|
|
62 |
subtest ImportBreedingAuth => sub { |
63 |
plan tests => 4; |
64 |
|
65 |
my $builder = t::lib::TestBuilder->new; |
66 |
my $test = $builder->build_sample_biblio(); |
67 |
my $record = MARC::Record->new(); |
68 |
$record->append_fields( |
69 |
MARC::Field->new('001', '4815162342'), |
70 |
MARC::Field->new('100', ' ', ' ', a => 'Jansson, Tove'), |
71 |
); |
72 |
|
73 |
my $breedingid = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); |
74 |
ok( $breedingid, "We got a breeding id back"); |
75 |
my $breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"kidclamp","UTF8"); |
76 |
is( $breedingid, $breedingid_1, "For the same record, we get the same id"); |
77 |
$breedingid_1 = C4::Breeding::ImportBreedingAuth($record,"marcelr","UTF8"); |
78 |
is( $breedingid, $breedingid_1, "For the same record in a different file, we get a new id"); |
79 |
my $test_1 = $builder->build_sample_biblio(); |
80 |
my $record_1 = MARC::Record->new(); |
81 |
$record_1->append_fields( |
82 |
MARC::Field->new('001', '8675309'), |
83 |
MARC::Field->new('100', ' ', ' ', a => 'Cooper, Susan'), |
84 |
); |
85 |
my $breedingid_2 = C4::Breeding::ImportBreedingAuth($record_1,"kidclamp","UTF8"); |
86 |
isnt( $breedingid, $breedingid_2, "For a new record, we get a new id"); |
87 |
}; |
88 |
|
60 |
#------------------------------------------------------------------------------- |
89 |
#------------------------------------------------------------------------------- |
61 |
|
90 |
|
62 |
sub test_build_translate_query { |
91 |
sub test_build_translate_query { |
Lines 237-239
sub test_add_rowdata {
Link Here
|
237 |
# Test repeatble tags,the trailing whitespace is a normal side-effect of _add_custom_row_data |
266 |
# Test repeatble tags,the trailing whitespace is a normal side-effect of _add_custom_row_data |
238 |
is_deeply(\$returned_row->{"035\$a"}, \["First 035 ", "Second 035 "],"_add_rowdata supports repeatable tags"); |
267 |
is_deeply(\$returned_row->{"035\$a"}, \["First 035 ", "Second 035 "],"_add_rowdata supports repeatable tags"); |
239 |
} |
268 |
} |
240 |
- |
269 |
|