|
Lines 24-30
use MARC::Record;
Link Here
|
| 24 |
use XML::Simple; |
24 |
use XML::Simple; |
| 25 |
use C4::MarcModificationTemplates; |
25 |
use C4::MarcModificationTemplates; |
| 26 |
use Koha::MarcModificationTemplates; |
26 |
use Koha::MarcModificationTemplates; |
| 27 |
use C4::Biblio qw(AddBiblio ModBiblioMarc GetMarcBiblio); |
27 |
use C4::Biblio qw(AddBiblio ModBiblioMarc DelBiblio); |
|
|
28 |
use Koha::Biblios; |
| 28 |
|
29 |
|
| 29 |
eval{ |
30 |
eval{ |
| 30 |
use C4::Context; |
31 |
use C4::Context; |
|
Lines 45-51
if (not defined $intranet) {
Link Here
|
| 45 |
} |
46 |
} |
| 46 |
|
47 |
|
| 47 |
subtest 'Templates applied using simple and advanced MARC Editor' => sub { |
48 |
subtest 'Templates applied using simple and advanced MARC Editor' => sub { |
| 48 |
plan tests => 13; |
49 |
plan tests => 14; |
| 49 |
|
50 |
|
| 50 |
# Create "Test" MARC modification template |
51 |
# Create "Test" MARC modification template |
| 51 |
#my $template_id = AddModificationTemplate('TEST'); |
52 |
#my $template_id = AddModificationTemplate('TEST'); |
|
Lines 85-91
subtest 'Templates applied using simple and advanced MARC Editor' => sub {
Link Here
|
| 85 |
); |
86 |
); |
| 86 |
my ($biblionumber) = AddBiblio($record, ''); |
87 |
my ($biblionumber) = AddBiblio($record, ''); |
| 87 |
|
88 |
|
| 88 |
my $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); |
89 |
my $saved_record = Koha::Biblios->find($biblionumber)->metadata->record(); |
| 89 |
my $saved_record_250_field = $saved_record->field('250'); |
90 |
my $saved_record_250_field = $saved_record->field('250'); |
| 90 |
isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved'); |
91 |
isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved'); |
| 91 |
is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio'); |
92 |
is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio'); |
|
Lines 100-109
subtest 'Templates applied using simple and advanced MARC Editor' => sub {
Link Here
|
| 100 |
$agent->field('password', $password); |
101 |
$agent->field('password', $password); |
| 101 |
$agent->field('userid', $user); |
102 |
$agent->field('userid', $user); |
| 102 |
$agent->field('branch', ''); |
103 |
$agent->field('branch', ''); |
| 103 |
$agent->click_ok('', 'Login to staff client'); |
104 |
$agent->click_ok('', 'Login to staff interface'); |
|
|
105 |
|
| 106 |
$agent->content_lacks('Invalid username or password', 'Logged in to staff interface'); |
| 104 |
|
107 |
|
| 105 |
$agent->get_ok("$intranet/cgi-bin/koha/mainpage.pl", 'Load main page'); #FIXME: Remove? |
108 |
$agent->get_ok("$intranet/cgi-bin/koha/mainpage.pl", 'Load main page'); #FIXME: Remove? |
| 106 |
$agent->get_ok("$intranet/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber", 'Load bibliographic record in simple MARC editor'); |
109 |
$agent->get_ok("$intranet/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber", 'Load bibliographic record in simple MARC editor'); |
|
|
110 |
|
| 107 |
$agent->submit_form_ok( |
111 |
$agent->submit_form_ok( |
| 108 |
{ |
112 |
{ |
| 109 |
form_id => 'f', |
113 |
form_id => 'f', |
|
Lines 112-118
subtest 'Templates applied using simple and advanced MARC Editor' => sub {
Link Here
|
| 112 |
'Save bibliographic record using simple MARC editor' |
116 |
'Save bibliographic record using simple MARC editor' |
| 113 |
); |
117 |
); |
| 114 |
|
118 |
|
| 115 |
$saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); |
119 |
$saved_record = Koha::Biblios->find($biblionumber)->metadata->record(); |
| 116 |
$saved_record_250_field = $saved_record->field('250'); |
120 |
$saved_record_250_field = $saved_record->field('250'); |
| 117 |
is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template'); |
121 |
is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template'); |
| 118 |
|
122 |
|
| 119 |
- |
|
|