Fix how logging gets intercepted. It used to be on by default, now it must be turned on.
This commit is contained in:
parent
78776f2f33
commit
06f52bae9a
6 changed files with 29 additions and 7 deletions
|
|
@ -123,13 +123,6 @@ BEGIN {
|
|||
$SESSION = WebGUI::Session->open( $WEBGUI_ROOT, $CONFIG_FILE );
|
||||
$SESSION->{_request} = $pseudoRequest;
|
||||
|
||||
my $logger = $SESSION->errorHandler->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]} );
|
||||
}
|
||||
|
||||
END {
|
||||
|
|
@ -146,6 +139,24 @@ END {
|
|||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 interceptLogging
|
||||
|
||||
Intercept logging request and capture them in buffer variables for testing
|
||||
|
||||
=cut
|
||||
|
||||
sub interceptLogging {
|
||||
my $logger = $SESSION->errorHandler->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]} );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 config
|
||||
|
||||
Returns the config object from the session.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue