11 my $context = new Test
::MockModule
('C4::Context');
12 my ( $conf, $value ) = @_;
13 $configs{$conf} = $value;
14 $context->mock('config', sub {
15 my ( $self, $conf ) = @_;
16 if ( exists $configs{$conf} ) {
17 return $configs{$conf}
19 my $method = $context->original('config');
20 return $method->($self, $conf);
27 my ( $pref, $value ) = @_;
29 $preferences{lc($pref)} = $value;
31 my $context = new Test
::MockModule
('C4::Context');
32 $context->mock('preference', sub {
33 my ( $self, $pref ) = @_;
35 if ( exists $preferences{$pref} ) {
36 return $preferences{$pref}
38 my $method = $context->original('preference');
39 return $method->($self, $pref);