mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
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
|
* Creates a new authentication manager using the provided config (or the
|
||||||
* configuration provided in the authentication.ini if no config is given)
|
* configuration provided in the authentication.ini if no config is given).
|
||||||
* and with the given options.
|
|
||||||
*
|
*
|
||||||
* @param Zend_Config $config The configuration to use for authentication
|
* @param Zend_Config $config The configuration to use for authentication
|
||||||
* instead of the authentication.ini
|
* 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)) {
|
$this->config = $config === null ? IcingaConfig::app('authentication') : $config;
|
||||||
$config = IcingaConfig::app('authentication');
|
$this->setupBackends($this->config);
|
||||||
}
|
|
||||||
|
|
||||||
if ($config !== null) {
|
|
||||||
$this->setupBackends($config);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a singleton instance of our self
|
* Get the authentication manager
|
||||||
*
|
*
|
||||||
* @param Zend_Config $config
|
* @param Zend_Config $config
|
||||||
* @param array $options
|
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
* @see Manager:__construct
|
* @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) {
|
if (self::$instance === null) {
|
||||||
self::$instance = new Manager($config, $options);
|
self::$instance = new static($config);
|
||||||
}
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ require_once 'Zend/Config.php';
|
|||||||
require_once BaseTestCase::$libDir . '/Application/Logger.php';
|
require_once BaseTestCase::$libDir . '/Application/Logger.php';
|
||||||
require_once BaseTestCase::$libDir . '/Authentication/Manager.php';
|
require_once BaseTestCase::$libDir . '/Authentication/Manager.php';
|
||||||
require_once BaseTestCase::$libDir . '/Authentication/Credential.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/ConfigurationError.php';
|
||||||
require_once BaseTestCase::$libDir . '/Exception/ProgrammingError.php';
|
require_once BaseTestCase::$libDir . '/Exception/ProgrammingError.php';
|
||||||
require_once BaseTestCase::$libDir . '/Web/Session.php';
|
require_once BaseTestCase::$libDir . '/Web/Session.php';
|
||||||
@ -84,12 +85,8 @@ class ManagerTest extends BaseTestCase
|
|||||||
$managerConfig = new Zend_Config(array());
|
$managerConfig = new Zend_Config(array());
|
||||||
}
|
}
|
||||||
|
|
||||||
$managerOptions = array(
|
|
||||||
'noDefaultConfig' => true
|
|
||||||
);
|
|
||||||
|
|
||||||
Session::create($session);
|
Session::create($session);
|
||||||
$manager = AuthManager::getInstance($managerConfig, $managerOptions);
|
$manager = AuthManager::getInstance($managerConfig);
|
||||||
|
|
||||||
if ($nobackend === false) {
|
if ($nobackend === false) {
|
||||||
$backend = new BackendMock();
|
$backend = new BackendMock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user