when overriding Log::Log4perl for testing, set the is_debug flag to true

This commit is contained in:
Colin Kuskie 2008-08-21 23:45:00 +00:00
parent b3ad74e267
commit 5fc629993a

View file

@ -141,7 +141,8 @@ END {
=head2 interceptLogging
Intercept logging request and capture them in buffer variables for testing
Intercept logging request and capture them in buffer variables for testing. Also,
mock the isDebug flag so that debug output is always generated.
=cut
@ -149,10 +150,11 @@ sub interceptLogging {
my $logger = $SESSION->log->getLogger;
$logger = Test::MockObject::Extends->new( $logger );
$logger->mock( 'warn', sub { $WebGUI::Test::logger_warns = $_[1]} );
$logger->mock( 'debug', sub { $WebGUI::Test::logger_debug = $_[1]} );
$logger->mock( 'info', sub { $WebGUI::Test::logger_info = $_[1]} );
$logger->mock( 'error', sub { $WebGUI::Test::logger_error = $_[1]} );
$logger->mock( 'warn', sub { $WebGUI::Test::logger_warns = $_[1]} );
$logger->mock( 'debug', sub { $WebGUI::Test::logger_debug = $_[1]} );
$logger->mock( 'info', sub { $WebGUI::Test::logger_info = $_[1]} );
$logger->mock( 'error', sub { $WebGUI::Test::logger_error = $_[1]} );
$logger->mock( 'isDebug', sub { return 1 } );
}
#----------------------------------------------------------------------------