47 protected $ini_file =
'/var/www/ilias/data/trunk/client.ini.php';
56 $this->error_reporting_backup = error_reporting();
57 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING & ~E_STRICT);
59 PHPUnit_Framework_Error_Notice::$enabled =
false;
60 PHPUnit_Framework_Error_Deprecated::$enabled =
false;
62 require_once(
'./libs/composer/vendor/autoload.php');
64 define(
'DEVMODE',
true);
66 require_once(
'./Services/Database/classes/class.ilDBWrapperFactory.php');
97 require_once(
'./Services/Init/classes/class.ilIniFile.php');
98 require_once(
'./Services/Init/classes/class.ilErrorHandling.php');
100 $ilClientIniFile->read();
101 $this->type = $ilClientIniFile->readVariable(
"db",
"type");
103 $return = $ilDBInterface->
connect();
111 error_reporting($this->error_reporting_backup);
118 public function testPrimaryKeys()
124 $all_tables_primary_mock =
array();
125 $all_tables_primary_actual =
array();
126 foreach ($this->db->listTables() as
$table) {
127 $constraints = $manager->listTableConstraints(
$table);
128 $all_tables_primary_actual[
$table] = $constraints[0];
129 $all_tables_primary_mock[
$table] =
'primary';
132 $this->assertEquals($all_tables_primary_mock, $all_tables_primary_actual);
139 public function testIndicesOrPrimaries()
145 $all_tables_primary_mock =
array();
146 $all_tables_primary_actual =
array();
147 foreach ($this->db->listTables() as
$table) {
148 $indices = $manager->listTableIndexes(
$table);
149 $constraints = $manager->listTableConstraints(
$table);
150 $count = count($indices) + count($constraints);
151 $all_tables_primary_actual[
$table] = $count;
152 $all_tables_primary_mock[
$table] = $count ? $count : 1;
155 $this->assertEquals($all_tables_primary_mock, $all_tables_primary_actual);
initFromIniFile($tmpClientIniFile=null)
connect(ilDBInterface $ilDBInterface)
connect($return_false_on_error=false)
TestCase for the ilDatabaseCommonTest.
const TYPE_PDO_MYSQL_INNODB
Create styles array
The data for the language used.
if(empty($password)) $table
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'