10 my $context = new Test::MockModule('C4::Context');
11 my ( $conf, $value ) = @_;
12 $configs{$conf} = $value;
13 $context->mock('config', sub {
14 my ( $self, $conf ) = @_;
15 if ( exists $configs{$conf} ) {
16 return $configs{$conf}
18 my $method = $context->original('config');
19 return $method->($self, $conf);
26 my ( $pref, $value ) = @_;
28 $preferences{lc($pref)} = $value;
30 my $context = new Test::MockModule('C4::Context');
31 $context->mock('preference', sub {
32 my ( $self, $pref ) = @_;
34 if ( exists $preferences{$pref} ) {
35 return $preferences{$pref}
37 my $method = $context->original('preference');
38 return $method->($self, $pref);