add test for multi-auth
This commit is contained in:
parent
20e3aef0b5
commit
3010e79b0e
1 changed files with 17 additions and 17 deletions
|
|
@ -27,26 +27,26 @@ my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Test package for method dispatch
|
# Test package for method dispatch
|
||||||
BEGIN {
|
BEGIN { $INC{'WebGUI/Auth/TestAuth.pm'} = __FILE__; }
|
||||||
package WebGUI::Auth::TestAuth;
|
|
||||||
|
|
||||||
use base 'WebGUI::Auth';
|
package WebGUI::Auth::TestAuth;
|
||||||
|
|
||||||
sub new {
|
use base 'WebGUI::Auth';
|
||||||
my $self = $_[0]->SUPER::new(@_);
|
|
||||||
$self->setCallable( ['callable'] );
|
|
||||||
return bless $self, 'WebGUI::Auth::TestAuth'; # Auth requires rebless
|
|
||||||
}
|
|
||||||
|
|
||||||
sub callable {
|
sub new {
|
||||||
return "callable";
|
my $self = shift->SUPER::new(@_);
|
||||||
}
|
$self->setCallable( ['callable'] );
|
||||||
|
return bless $self, 'WebGUI::Auth::TestAuth'; # Auth requires rebless
|
||||||
sub www_verify {
|
|
||||||
return "verify";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$INC{'WebGUI/Auth/TestAuth.pm'} = __FILE__;
|
|
||||||
|
sub callable {
|
||||||
|
return "callable";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub www_verify {
|
||||||
|
return "verify";
|
||||||
|
}
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -74,7 +74,7 @@ isa_ok(
|
||||||
$session->config->addToArray( 'authMethods', 'TestAuth' );
|
$session->config->addToArray( 'authMethods', 'TestAuth' );
|
||||||
isa_ok(
|
isa_ok(
|
||||||
WebGUI::Operation::Auth::getInstance( $session ),
|
WebGUI::Operation::Auth::getInstance( $session ),
|
||||||
'WebGUI::Auth::' . $session->setting->get('authMethod'),
|
'WebGUI::Auth::TestAuth',
|
||||||
'AuthType in config file, so return instance of authType',
|
'AuthType in config file, so return instance of authType',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue