Lines 63-76
subtest "StripWhitespaceChars tests" => sub {
Link Here
|
63 |
is( $title, " My\ntitle\n", 'Title has whitespace characters' ); |
63 |
is( $title, " My\ntitle\n", 'Title has whitespace characters' ); |
64 |
|
64 |
|
65 |
C4::Biblio::ModBiblioMarc( $record, $biblio->biblionumber ); |
65 |
C4::Biblio::ModBiblioMarc( $record, $biblio->biblionumber ); |
66 |
my $savedrec = C4::Biblio::GetMarcBiblio({ biblionumber => $biblio->biblionumber }); |
66 |
$biblio = Koha::Biblios->find( $biblio->biblionumber ); |
|
|
67 |
my $savedrec = $biblio->metadata->record; |
67 |
my $savedtitle = $savedrec->title; |
68 |
my $savedtitle = $savedrec->title; |
68 |
is( $savedtitle, " My\ntitle\n", "Title still has whitespace characters because StripWhitespaceChars is disabled" ); |
69 |
is( $savedtitle, " My\ntitle\n", "Title still has whitespace characters because StripWhitespaceChars is disabled" ); |
69 |
|
70 |
|
70 |
t::lib::Mocks::mock_preference('StripWhitespaceChars', 1); |
71 |
t::lib::Mocks::mock_preference('StripWhitespaceChars', 1); |
71 |
|
72 |
|
72 |
C4::Biblio::ModBiblioMarc( $record, $biblio->biblionumber ); |
73 |
C4::Biblio::ModBiblioMarc( $record, $biblio->biblionumber ); |
73 |
my $amendedrec = C4::Biblio::GetMarcBiblio({ biblionumber => $biblio->biblionumber }); |
74 |
$biblio = Koha::Biblios->find( $biblio->biblionumber ); |
|
|
75 |
my $amendedrec = $biblio->metadata->record; |
74 |
my $amendedtitle = $amendedrec->title; |
76 |
my $amendedtitle = $amendedrec->title; |
75 |
is( $amendedtitle, "My title", "Whitespace characters removed from title because StripWhitespaceChars is enabled" ); |
77 |
is( $amendedtitle, "My title", "Whitespace characters removed from title because StripWhitespaceChars is enabled" ); |
76 |
}; |
78 |
}; |
77 |
- |
|
|