Fix PHP Fatal error: Class 'Icinga\Authentication\Membership' not found in ManagerTest.php
This commit is contained in:
parent
d6768872c7
commit
41ffa1d7c2
|
@ -89,39 +89,29 @@ class Manager
|
|||
|
||||
/**
|
||||
* Creates a new authentication manager using the provided config (or the
|
||||
* configuration provided in the authentication.ini if no config is given)
|
||||
* and with the given options.
|
||||
* configuration provided in the authentication.ini if no config is given).
|
||||
*
|
||||
* @param Zend_Config $config The configuration to use for authentication
|
||||
* instead of the authentication.ini
|
||||
* @param array $options Additional options that affect the managers behaviour.
|
||||
* Supported values:
|
||||
* * noDefaultConfig: Disable default configuration from authentication.ini
|
||||
**/
|
||||
private function __construct(Zend_Config $config = null, array $options = array())
|
||||
private function __construct(Zend_Config $config = null)
|
||||
{
|
||||
if ($config === null && !(isset($options['noDefaultConfig']) && $options['noDefaultConfig'] == true)) {
|
||||
$config = IcingaConfig::app('authentication');
|
||||
}
|
||||
|
||||
if ($config !== null) {
|
||||
$this->setupBackends($config);
|
||||
}
|
||||
$this->config = $config === null ? IcingaConfig::app('authentication') : $config;
|
||||
$this->setupBackends($this->config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a singleton instance of our self
|
||||
* Get the authentication manager
|
||||
*
|
||||
* @param Zend_Config $config
|
||||
* @param array $options
|
||||
* @param Zend_Config $config
|
||||
*
|
||||
* @return self
|
||||
* @see Manager:__construct
|
||||
*/
|
||||
public static function getInstance(Zend_Config $config = null, array $options = array())
|
||||
public static function getInstance(Zend_Config $config = null)
|
||||
{
|
||||
if (self::$instance === null) {
|
||||
self::$instance = new Manager($config, $options);
|
||||
self::$instance = new static($config);
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ require_once 'Zend/Config.php';
|
|||
require_once BaseTestCase::$libDir . '/Application/Logger.php';
|
||||
require_once BaseTestCase::$libDir . '/Authentication/Manager.php';
|
||||
require_once BaseTestCase::$libDir . '/Authentication/Credential.php';
|
||||
require_once BaseTestCase::$libDir . '/Authentication/Membership.php';
|
||||
require_once BaseTestCase::$libDir . '/Exception/ConfigurationError.php';
|
||||
require_once BaseTestCase::$libDir . '/Exception/ProgrammingError.php';
|
||||
require_once BaseTestCase::$libDir . '/Web/Session.php';
|
||||
|
@ -84,12 +85,8 @@ class ManagerTest extends BaseTestCase
|
|||
$managerConfig = new Zend_Config(array());
|
||||
}
|
||||
|
||||
$managerOptions = array(
|
||||
'noDefaultConfig' => true
|
||||
);
|
||||
|
||||
Session::create($session);
|
||||
$manager = AuthManager::getInstance($managerConfig, $managerOptions);
|
||||
$manager = AuthManager::getInstance($managerConfig);
|
||||
|
||||
if ($nobackend === false) {
|
||||
$backend = new BackendMock();
|
||||
|
|
Loading…
Reference in New Issue