Lines 18-25
Link Here
|
18 |
|
18 |
|
19 |
use Modern::Perl; |
19 |
use Modern::Perl; |
20 |
use C4::Context; |
20 |
use C4::Context; |
21 |
use Test::More tests => 145; |
21 |
use Test::More tests => 147; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
|
|
23 |
use Test::Warn; |
23 |
|
24 |
|
24 |
|
25 |
|
25 |
BEGIN { |
26 |
BEGIN { |
Lines 88-96
ok (!defined(AddOAISet($set_without_name)), 'AddOAISet without "name" field is u
Link Here
|
88 |
'spec' => 'specWrong', |
89 |
'spec' => 'specWrong', |
89 |
'name' => 'nameWrong', |
90 |
'name' => 'nameWrong', |
90 |
}; |
91 |
}; |
91 |
my $setWrong_id = AddOAISet($setWrong); |
92 |
my $setWrong_id; |
|
|
93 |
warning_is { $setWrong_id = AddOAISet($setWrong) } |
94 |
'AddOAISet failed', |
95 |
'AddOAISet raises warning if there is a problem with SET spec or SET name'; |
92 |
|
96 |
|
93 |
DelOAISet($setWrong_id); |
97 |
ok(!defined $setWrong_id, '$setWrong_id is not defined'); |
94 |
} |
98 |
} |
95 |
|
99 |
|
96 |
#Adding a Set without description |
100 |
#Adding a Set without description |
Lines 197-204
my $new_set_without_id = {
Link Here
|
197 |
'name' => 'nameNoSpec', |
201 |
'name' => 'nameNoSpec', |
198 |
'descriptions' => ['descNoSpecNoName'], |
202 |
'descriptions' => ['descNoSpecNoName'], |
199 |
}; |
203 |
}; |
200 |
ok (!defined(ModOAISet($new_set_without_id)), 'ModOAISet without "id" field is undef'); |
204 |
warning_is { ModOAISet($new_set_without_id) } |
201 |
|
205 |
'Set ID not defined, can\'t modify the set', |
|
|
206 |
'ModOAISet raises warning if Set ID is not defined'; |
202 |
|
207 |
|
203 |
my $new_set_without_spec_and_name = { |
208 |
my $new_set_without_spec_and_name = { |
204 |
'id' => $set1_id, |
209 |
'id' => $set1_id, |
Lines 595-604
my @setsNotEq = CalcOAISetsBiblio($record);
Link Here
|
595 |
is_deeply(@setsNotEq, $setNotVH_id, 'The $record only belongs to $setNotVH'); |
600 |
is_deeply(@setsNotEq, $setNotVH_id, 'The $record only belongs to $setNotVH'); |
596 |
|
601 |
|
597 |
|
602 |
|
598 |
# |
|
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
603 |
# ---------- Subs -------------------------------- |
604 |
# ---------- Subs -------------------------------- |
604 |
|
605 |
|
605 |
- |
|
|