Browse files

BUGFIX Unregistering custom Authenticators in SecurityTest->setUp()

  • Loading branch information...
1 parent da909a0 commit d099c7e5ba8b46e915869fcb6a4631a0e9d042dc @chillu chillu committed Jan 11, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/security/SecurityTest.php
View
6 tests/security/SecurityTest.php
@@ -20,6 +20,9 @@ function setUp() {
// This test assumes that MemberAuthenticator is present and the default
$this->priorAuthenticators = Authenticator::get_authenticators();
$this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
+ foreach($this->priorAuthenticators as $authenticator) {
+ Authenticator::unregister($authenticator);
+ }
Authenticator::register('MemberAuthenticator');
Authenticator::set_default_authenticator('MemberAuthenticator');
@@ -38,6 +41,9 @@ function tearDown() {
if(!in_array('MemberAuthenticator', $this->priorAuthenticators)) {
Authenticator::unregister('MemberAuthenticator');
}
+ foreach($this->priorAuthenticators as $authenticator) {
+ Authenticator::register($authenticator);
+ }
Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
// Restore unique identifier field

0 comments on commit d099c7e

Please sign in to comment.