Lines 18-23
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 1; |
20 |
use Test::More tests => 1; |
|
|
21 |
use Test::MockModule; |
22 |
|
21 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
22 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
23 |
|
25 |
|
Lines 36-43
subtest 'EmbedItemsAvailability tests' => sub {
Link Here
|
36 |
|
38 |
|
37 |
$schema->storage->txn_begin(); |
39 |
$schema->storage->txn_begin(); |
38 |
|
40 |
|
|
|
41 |
my $biblio = Test::MockModule->new('C4::Biblio'); |
42 |
$biblio->mock( 'GetMarcFromKohaField', sub { |
43 |
my ( $kohafield, $frameworkcode ) = @_; |
44 |
if ( $kohafield eq 'biblio.biblionumber' ) { |
45 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
46 |
return ( '001', '@' ); |
47 |
} |
48 |
else { |
49 |
return ( '999', 'c' ); |
50 |
} |
51 |
} |
52 |
else { |
53 |
my $func_ref = $biblio->original( 'GetMarcFromKohaField' ); |
54 |
&$func_ref( $kohafield, $frameworkcode ); |
55 |
} |
56 |
}); |
57 |
|
39 |
# MARC21 tests |
58 |
# MARC21 tests |
40 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
59 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
|
|
60 |
|
41 |
# Create a dummy record |
61 |
# Create a dummy record |
42 |
my ( $biblionumber, $biblioitemnumber ) = AddBiblio(MARC::Record->new(), ''); |
62 |
my ( $biblionumber, $biblioitemnumber ) = AddBiblio(MARC::Record->new(), ''); |
43 |
|
63 |
|
44 |
- |
|
|