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 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-108
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 |
$agent->content_lacks('Invalid username or password', 'Logged in to staff interface'); |
104 |
|
106 |
|
105 |
$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'); |
107 |
$agent->get_ok("$intranet/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber", 'Load bibliographic record in simple MARC editor'); |
107 |
$agent->submit_form_ok( |
108 |
$agent->submit_form_ok( |
108 |
{ |
109 |
{ |
Lines 112-118
subtest 'Templates applied using simple and advanced MARC Editor' => sub {
Link Here
|
112 |
'Save bibliographic record using simple MARC editor' |
113 |
'Save bibliographic record using simple MARC editor' |
113 |
); |
114 |
); |
114 |
|
115 |
|
115 |
$saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); |
116 |
$saved_record = Koha::Biblios->find($biblionumber)->metadata->record(); |
116 |
$saved_record_250_field = $saved_record->field('250'); |
117 |
$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'); |
118 |
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 |
|
119 |
|
119 |
- |
|
|