Lines 18-28
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use DBI; |
20 |
use DBI; |
21 |
use Test::More tests => 28; |
21 |
use Test::More tests => 29; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
use YAML; |
24 |
use YAML; |
25 |
|
25 |
|
|
|
26 |
use t::lib::Mocks; |
27 |
|
26 |
BEGIN { |
28 |
BEGIN { |
27 |
use_ok('C4::Context'); |
29 |
use_ok('C4::Context'); |
28 |
} |
30 |
} |
Lines 50-55
subtest 'yaml_preference() tests' => sub {
Link Here
|
50 |
$context->unmock( 'preference' ); |
52 |
$context->unmock( 'preference' ); |
51 |
}; |
53 |
}; |
52 |
|
54 |
|
|
|
55 |
subtest 'needs_install() tests' => sub { |
56 |
|
57 |
plan tests => 2; |
58 |
|
59 |
t::lib::Mocks::mock_preference( 'Version', '3.0.0' ); |
60 |
is( C4::Context->needs_install, 0, 'Preference is defined, no need to install' ); |
61 |
|
62 |
t::lib::Mocks::mock_preference( 'Version', undef ); # the behaviour when ->preference fails to fetch |
63 |
is( C4::Context->needs_install, 1, "->preference(Version) is not defined, need to install" ); |
64 |
}; |
65 |
|
53 |
my $context = new Test::MockModule('C4::Context'); |
66 |
my $context = new Test::MockModule('C4::Context'); |
54 |
my $userenv = {}; |
67 |
my $userenv = {}; |
55 |
|
68 |
|
56 |
- |
|
|