Lines 36-42
$schema->storage->txn_begin;
Link Here
|
36 |
my $dbh = C4::Context->dbh; |
36 |
my $dbh = C4::Context->dbh; |
37 |
|
37 |
|
38 |
subtest 'Test Koha::Biblio::marc()' => sub { |
38 |
subtest 'Test Koha::Biblio::marc()' => sub { |
39 |
plan tests => 3; |
39 |
plan tests => 4; |
40 |
|
40 |
|
41 |
my $title = 'Oranges and Peaches'; |
41 |
my $title = 'Oranges and Peaches'; |
42 |
|
42 |
|
Lines 48-57
subtest 'Test Koha::Biblio::marc()' => sub {
Link Here
|
48 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
48 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
49 |
is( ref $biblio, 'Koha::Biblio', 'Found a Koha::Biblio object' ); |
49 |
is( ref $biblio, 'Koha::Biblio', 'Found a Koha::Biblio object' ); |
50 |
|
50 |
|
51 |
my $marc = $biblio->marc(); |
51 |
my $metadata = $biblio->metadata; |
52 |
is( ref $marc, 'MARC::Record', 'Method marc() returned a MARC::Record object' ); |
52 |
is( ref $metadata, 'Koha::Biblio::Metadata', 'Method metadata() returned a Koha::Biblio::Metadata object' ); |
53 |
|
53 |
|
54 |
is( $marc->field('245')->subfield("a"), $title, 'Title in 245$a matches title from original record object' ); |
54 |
my $record2 = $metadata->record(); |
|
|
55 |
is( ref $record2, 'MARC::Record', 'Method record() returned a MARC::Record object' ); |
56 |
|
57 |
is( $record2->field('245')->subfield("a"), $title, 'Title in 245$a matches title from original record object' ); |
55 |
}; |
58 |
}; |
56 |
|
59 |
|
57 |
$schema->storage->txn_rollback; |
60 |
$schema->storage->txn_rollback; |
58 |
- |
|
|