Lines 22-35
use Test::MockModule;
Link Here
|
22 |
use MARC::Record; |
22 |
use MARC::Record; |
23 |
use t::lib::Mocks qw( mock_preference ); |
23 |
use t::lib::Mocks qw( mock_preference ); |
24 |
|
24 |
|
|
|
25 |
use Koha::Database; |
26 |
|
25 |
BEGIN { |
27 |
BEGIN { |
26 |
use_ok('C4::Biblio'); |
28 |
use_ok('C4::Biblio'); |
27 |
} |
29 |
} |
28 |
|
30 |
|
29 |
my $dbh = C4::Context->dbh; |
31 |
my $schema = Koha::Database->new->schema; |
30 |
# Start transaction |
32 |
$schema->storage->txn_begin; |
31 |
$dbh->{AutoCommit} = 0; |
|
|
32 |
$dbh->{RaiseError} = 1; |
33 |
|
33 |
|
34 |
my $template = '#200|<h2>Title : |{200a}{ by 200f}|</h2>'; |
34 |
my $template = '#200|<h2>Title : |{200a}{ by 200f}|</h2>'; |
35 |
my $opac_template = '#200|<h2>Title : |{200a}{ (200f)}|</h2>'; |
35 |
my $opac_template = '#200|<h2>Title : |{200a}{ (200f)}|</h2>'; |
Lines 41-50
$record->append_fields(
Link Here
|
41 |
MARC::Field->new('200', '', '', 'a' => 'Mountains'), |
41 |
MARC::Field->new('200', '', '', 'a' => 'Mountains'), |
42 |
MARC::Field->new('200', '', '', 'f' => 'Keith Lye'), |
42 |
MARC::Field->new('200', '', '', 'f' => 'Keith Lye'), |
43 |
); |
43 |
); |
44 |
my ($bibnum, $title, $bibitemnum) = AddBiblio($record, ''); |
|
|
45 |
|
44 |
|
46 |
my $isbd = GetISBDView({ record => $record }); |
45 |
my $isbd = GetISBDView({ record => $record }); |
47 |
is($isbd, '<h2>Title : Mountains by Keith Lye</h2>', 'ISBD is correct'); |
46 |
is($isbd, '<h2>Title : Mountains by Keith Lye</h2>', 'ISBD is correct'); |
48 |
|
47 |
|
49 |
my $opacisbd = GetISBDView({ record => $record, template => 'opac' }); |
48 |
my $opacisbd = GetISBDView({ record => $record, template => 'opac' }); |
50 |
is($opacisbd, '<h2>Title : Mountains (Keith Lye)</h2>', 'OPAC ISBD is correct'); |
49 |
is($opacisbd, '<h2>Title : Mountains (Keith Lye)</h2>', 'OPAC ISBD is correct'); |
51 |
- |
50 |
|
|
|
51 |
$schema->storage->txn_rollback; |