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

(-)a/t/Debug.t (-14 / +7 lines)
Lines 1-25 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use strict;
3
use Modern::Perl;
4
use warnings;
4
use Test::More tests => 7;
5
6
use Test::More tests => 5;
7
5
8
use vars qw($debug $cgi_debug);
6
use vars qw($debug $cgi_debug);
9
7
10
BEGIN {
8
BEGIN {
11
$ENV{'KOHA_CGI_DEBUG'}='2';
9
    $ENV{'KOHA_CGI_DEBUG'}='2';
12
$ENV{'KOHA_DEBUG'}='5';
10
    $ENV{'KOHA_DEBUG'}='5';
13
	diag "BEFORE use:     \$debug is " . (defined     $debug ?     $debug : 'not defined');
11
    is($debug,    undef,"    \$debug is undefined as expected.");
14
	diag "BEFORE use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
12
    is($cgi_debug,undef,"\$cgi_debug is undefined as expected.");
15
	use_ok('C4::Debug');
13
    use_ok('C4::Debug');
16
}
14
}
17
15
18
diag " AFTER use:     \$debug is " . (defined     $debug ?     $debug : 'not defined');
19
diag " AFTER use: \$cgi_debug is " . (defined $cgi_debug ? $cgi_debug : 'not defined');
20
ok(defined     $debug, "    \$debug defined and imported.");
16
ok(defined     $debug, "    \$debug defined and imported.");
21
ok(defined $cgi_debug, "\$cgi_debug defined and imported.");
17
ok(defined $cgi_debug, "\$cgi_debug defined and imported.");
22
is($cgi_debug,2,"cgi_debug gets the ENV{'KOHA_CGI_DEBUG'}");
18
is($cgi_debug,2,"cgi_debug gets the ENV{'KOHA_CGI_DEBUG'}");
23
is($debug,5,"debug gets the ENV{'KOHA_DEBUG'}");
19
is($debug,5,"debug gets the ENV{'KOHA_DEBUG'}");
24
25
diag "Done.";
26
- 

Return to bug 14114