View | Details | Raw Unified | Return to bug 14751
Collapse All | Expand All

(-)a/t/Context.t (-12 / +14 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
use DBI;
4
use DBI;
5
use Test::More tests => 24;
5
use Test::More tests => 26;
6
use Test::MockModule;
6
use Test::MockModule;
7
7
8
BEGIN {
8
BEGIN {
Lines 49-61 is(C4::Context::db_scheme2dbi(), 'mysql', 'ask for nothing, get mysql'); Link Here
49
# C4::Context::interface
49
# C4::Context::interface
50
my $lastwarn;
50
my $lastwarn;
51
local $SIG{__WARN__} = sub { $lastwarn = $_[0] };
51
local $SIG{__WARN__} = sub { $lastwarn = $_[0] };
52
is(C4::Context->interface, 'opac');
52
is(C4::Context->interface, 'opac','interface defaults to opac');
53
is(C4::Context->interface('foobar'), 'opac');
53
is(C4::Context->interface('foobar'), 'opac', 'interface foobar');
54
like($lastwarn, qr/invalid interface : 'foobar'/);
54
like($lastwarn, qr/invalid interface : 'foobar'/, 'interface warn on foobar');
55
is(C4::Context->interface, 'opac');
55
is(C4::Context->interface, 'opac', 'interface still opac');
56
is(C4::Context->interface('intranet'), 'intranet');
56
is(C4::Context->interface('intranet'), 'intranet', 'interface intranet');
57
is(C4::Context->interface, 'intranet');
57
is(C4::Context->interface, 'intranet', 'interface still intranet');
58
is(C4::Context->interface('foobar'), 'intranet');
58
is(C4::Context->interface('foobar'), 'intranet', 'interface foobar again');
59
is(C4::Context->interface, 'intranet');
59
is(C4::Context->interface, 'intranet', 'interface still intranet');
60
is(C4::Context->interface('OPAC'), 'opac');
60
is(C4::Context->interface('OPAC'), 'opac', 'interface OPAC uc');
61
is(C4::Context->interface, 'opac');
61
is(C4::Context->interface, 'opac', 'interface still opac');
62
#Bug 14751
63
is( C4::Context->interface( 'SiP' ), 'sip', 'interface SiP' );
64
is( C4::Context->interface( 'COMMANDLINE' ), 'commandline', 'interface commandline uc' );
62
- 

Return to bug 14751