46 protected $ini_file =
'/var/www/ilias/data/trunk/client.ini.php';
54 $this->error_reporting_backup = error_reporting();
55 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING & ~E_STRICT);
57 PHPUnit_Framework_Error_Notice::$enabled =
false;
58 PHPUnit_Framework_Error_Deprecated::$enabled =
false;
60 require_once(
'./libs/composer/vendor/autoload.php');
62 define(
'DEVMODE',
true);
64 require_once(
'./Services/Database/classes/class.ilDBWrapperFactory.php');
92 require_once(
'./Services/Init/classes/class.ilIniFile.php');
93 require_once(
'./Services/Init/classes/class.ilErrorHandling.php');
95 $ilClientIniFile->read();
96 $this->type = $ilClientIniFile->readVariable(
"db",
"type");
98 $return = $ilDBInterface->
connect();
105 error_reporting($this->error_reporting_backup);
112 public function testPrimaryKeys() {
117 $all_tables_primary_mock =
array();
118 $all_tables_primary_actual =
array();
119 foreach ($this->db->listTables() as $table) {
120 $constraints = $manager->listTableConstraints($table);
121 $all_tables_primary_actual[$table] = $constraints[0];
122 $all_tables_primary_mock[$table] =
'primary';
125 $this->assertEquals($all_tables_primary_mock, $all_tables_primary_actual);
132 public function testIndicesOrPrimaries() {
137 $all_tables_primary_mock =
array();
138 $all_tables_primary_actual =
array();
139 foreach ($this->db->listTables() as $table) {
140 $indices = $manager->listTableIndexes($table);
141 $constraints = $manager->listTableConstraints($table);
142 $count = count($indices) + count($constraints);
143 $all_tables_primary_actual[$table] = $count;
144 $all_tables_primary_mock[$table] = $count ? $count : 1;
147 $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.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'