9 my $context = new Test
::MockModule
('C4::Context');
10 my ( $conf, $value ) = @_;
11 $configs{$conf} = $value;
12 $context->mock('config', sub {
13 my ( $self, $conf ) = @_;
14 if ( exists $configs{$conf} ) {
15 return $configs{$conf}
17 my $method = $context->original('config');
18 return $method->($self, $conf);
25 my $context = new Test
::MockModule
('C4::Context');
26 my ( $pref, $value ) = @_;
27 $preferences{$pref} = $value;
28 $context->mock('preference', sub {
29 my ( $self, $pref ) = @_;
30 if ( exists $preferences{$pref} ) {
31 return $preferences{$pref}
33 my $method = $context->original('preference');
34 return $method->($self, $pref);