56 require_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
57 ilUnitUtil::performInitialisation();
58 require_once(
'./Services/Database/classes/Atom/class.ilAtomQueryBase.php');
59 require_once(
'./Services/Database/classes/Atom/class.ilAtomQueryTransaction.php');
60 require_once(
'./Services/Database/classes/Atom/class.ilAtomQueryLock.php');
61 require_once(
'./Services/Database/classes/class.ilDBWrapperFactory.php');
63 global $ilClientIniFile;
65 $this->ilDBInterfaceGalera->initFromIniFile($ilClientIniFile);
66 $this->ilDBInterfaceGalera->connect();
69 $this->ilDBInterfaceInnoDB->initFromIniFile($ilClientIniFile);
70 $this->ilDBInterfaceInnoDB->connect();
76 $ilAtomQueryTransaction = $this->ilDBInterfaceGalera->buildAtomQuery();
80 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
126 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
127 $ilAtomQuery->addTableLock(
'object_data');
128 $this->assertEquals(array(), $ilAtomQuery->getRisks());
134 require_once(
'./Services/Database/classes/PDO/class.ilDBPdoMySQL.php');
135 require_once(
'./Services/Database/test/Atom/data/class.ilAtomQueryTestHelper.php');
137 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
144 $this->assertFalse($ilAtomQuery->checkCallable(
function () {
146 $this->assertFalse($ilAtomQuery->checkCallable(
function (
ilDBInterface $ilDBInterface, $someOtherParameter) {
148 $this->assertFalse($ilAtomQuery->checkCallable(
function ($someOtherParameter,
ilDBInterface $ilDBInterface) {
152 $this->assertFalse($ilAtomQuery->checkCallable(
function ($ilDBInterface) {
158 $this->assertFalse($ilAtomQuery->checkCallable(
'noClosure'));
164 $this->setExpectedException(
'ilDatabaseException');
166 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
180 if ($counter < $max) {
184 $result = $ilDBInterface->listTables();
187 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
188 $ilAtomQuery->addQueryCallable(
$query);
189 $ilAtomQuery->addTableLock(
'object_data');
191 $this->assertTrue(is_array(
$result));
202 if ($counter < $max) {
206 $result = $ilDBInterface->listTables();
209 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
210 $ilAtomQuery->addQueryCallable(
$query);
211 $ilAtomQuery->addTableLock(
'object_data');
215 $this->assertTrue(is_null(
$result));
222 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
230 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
231 $ilAtomQuery->addTableLock(
'object_data');
239 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
240 $ilAtomQuery->addTableLock(
'object_data');
241 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
243 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
251 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
252 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
253 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
254 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
263 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
264 $ilAtomQuery->addTableLock(
'il_db_tests_atom')->aliasName(
'alias_one');
265 $ilAtomQuery->addTableLock(
'il_db_tests_atom')->aliasName(
'alias_one');
266 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
const DB_ATOM_CLOSURE_NONE
Class ilAtomQueryTransaction.
const ISOLATION_SERIALIZABLE
static checkAnomaly($anomalie)
TestCase for the ilDatabaseAtomBaseTest.
testWrongIsolationLevel()
const ISOLATION_READ_COMMITED
Class ilDatabaseException.
const ISOLATION_REPEATED_READ
const TYPE_PDO_MYSQL_INNODB
testQueryWithTenException()
const DB_ATOM_CLOSURE_ALREADY_SET
const DB_ATOM_ISO_WRONG_LEVEL
const DB_ATOM_LOCK_NO_TABLE
const DB_ATOM_ANO_NOT_AVAILABLE
testLockSameTableWithAlias()
const ISOLATION_READ_UNCOMMITED
static checkIsolationLevel($isolation_level)
Class ilAtomQueryTestHelper.
const DB_ATOM_IDENTICAL_TABLES
testQueryWithFiveException()