mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
e51737f42a
commit
d5d0da6b1b
@ -1,13 +1,4 @@
|
|||||||
[users]
|
[users]
|
||||||
backend=Db
|
|
||||||
dbtype=mysql
|
|
||||||
table=account
|
|
||||||
host=localhost
|
|
||||||
password=icinga
|
|
||||||
user=icingaweb
|
|
||||||
db=icingaweb
|
|
||||||
|
|
||||||
[users-ldap]
|
|
||||||
backend=ldap
|
backend=ldap
|
||||||
hostname=localhost
|
hostname=localhost
|
||||||
root_dn="ou=people,dc=icinga,dc=org"
|
root_dn="ou=people,dc=icinga,dc=org"
|
||||||
@ -16,6 +7,15 @@ bind_pw=admin
|
|||||||
user_class=inetOrgPerson
|
user_class=inetOrgPerson
|
||||||
user_name_attribute=uid
|
user_name_attribute=uid
|
||||||
|
|
||||||
|
[users-mysql]
|
||||||
|
backend=Db
|
||||||
|
dbtype=mysql
|
||||||
|
table=account
|
||||||
|
host=localhost
|
||||||
|
password=icinga
|
||||||
|
user=icingaweb
|
||||||
|
db=icingaweb
|
||||||
|
|
||||||
[users-pgsql]
|
[users-pgsql]
|
||||||
backend=Db
|
backend=Db
|
||||||
dbtype=pgsql
|
dbtype=pgsql
|
||||||
|
@ -55,13 +55,24 @@ use Icinga\Application\Config;
|
|||||||
*/
|
*/
|
||||||
class DbUserBackendTest extends \PHPUnit_Framework_TestCase {
|
class DbUserBackendTest extends \PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
private $dbUserBackend;
|
/**
|
||||||
private $db;
|
* The table that is used to store the authentication data
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
private $testTable = 'account';
|
private $testTable = 'account';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The database that is used to store the authentication data
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
private $testDatabase = 'icinga_unittest';
|
private $testDatabase = 'icinga_unittest';
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Must be identical with the column names defined in DbUserBackend
|
* Mapping of columns
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $USER_NAME_COLUMN = 'user_name',
|
private $USER_NAME_COLUMN = 'user_name',
|
||||||
$FIRST_NAME_COLUMN = 'first_name',
|
$FIRST_NAME_COLUMN = 'first_name',
|
||||||
@ -73,10 +84,33 @@ class DbUserBackendTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$DOMAIN_COLUMN = 'domain',
|
$DOMAIN_COLUMN = 'domain',
|
||||||
$EMAIL_COLUMN = 'email';
|
$EMAIL_COLUMN = 'email';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example users
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
private $users;
|
private $users;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DbUserBackend configured to use MySQL
|
||||||
|
*
|
||||||
|
* @var DbUserBackend
|
||||||
|
*/
|
||||||
private $mysql;
|
private $mysql;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DbUserBackend configured to use PostgreSQL
|
||||||
|
*
|
||||||
|
* @var DbUserBackend
|
||||||
|
*/
|
||||||
private $pgsql;
|
private $pgsql;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the PDO names used for the different SQL databases.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
private $dbTypeMap = Array(
|
private $dbTypeMap = Array(
|
||||||
'mysql' => 'PDO_MYSQL',
|
'mysql' => 'PDO_MYSQL',
|
||||||
'pgsql' => 'PDO_PGSQL'
|
'pgsql' => 'PDO_PGSQL'
|
||||||
@ -103,6 +137,7 @@ class DbUserBackendTest extends \PHPUnit_Framework_TestCase {
|
|||||||
* Create a backend with the given database type
|
* Create a backend with the given database type
|
||||||
*
|
*
|
||||||
* @param $dbType The database type as a string, like 'mysql' or 'pgsql'.
|
* @param $dbType The database type as a string, like 'mysql' or 'pgsql'.
|
||||||
|
*
|
||||||
* @return DbUserBackend|null
|
* @return DbUserBackend|null
|
||||||
*/
|
*/
|
||||||
private function createBackend($dbType)
|
private function createBackend($dbType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user