|
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 => 14; |
5 |
use Test::More tests => 24; |
| 6 |
use Test::MockModule; |
6 |
use Test::MockModule; |
| 7 |
|
7 |
|
| 8 |
BEGIN { |
8 |
BEGIN { |
|
Lines 45-47
is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql');
Link Here
|
| 45 |
is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); |
45 |
is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); |
| 46 |
is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); |
46 |
is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); |
| 47 |
is(C4::Context::db_scheme2dbi(), 'mysql', 'ask for nothing, get mysql'); |
47 |
is(C4::Context::db_scheme2dbi(), 'mysql', 'ask for nothing, get mysql'); |
| 48 |
- |
48 |
|
|
|
49 |
# C4::Context::interface |
| 50 |
my $lastwarn; |
| 51 |
local $SIG{__WARN__} = sub { $lastwarn = $_[0] }; |
| 52 |
is(C4::Context->interface, 'opac'); |
| 53 |
is(C4::Context->interface('foobar'), 'opac'); |
| 54 |
like($lastwarn, qr/invalid interface : 'foobar'/); |
| 55 |
is(C4::Context->interface, 'opac'); |
| 56 |
is(C4::Context->interface('intranet'), 'intranet'); |
| 57 |
is(C4::Context->interface, 'intranet'); |
| 58 |
is(C4::Context->interface('foobar'), 'intranet'); |
| 59 |
is(C4::Context->interface, 'intranet'); |
| 60 |
is(C4::Context->interface('OPAC'), 'opac'); |
| 61 |
is(C4::Context->interface, 'opac'); |