56 protected function setUp() : void
58 ilUnitUtil::performInitialisation();
60 global $ilClientIniFile;
62 $this->ilDBInterfaceGalera->initFromIniFile($ilClientIniFile);
63 $this->ilDBInterfaceGalera->connect();
66 $this->ilDBInterfaceInnoDB->initFromIniFile($ilClientIniFile);
67 $this->ilDBInterfaceInnoDB->connect();
73 $ilAtomQueryTransaction = $this->ilDBInterfaceGalera->buildAtomQuery();
77 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
123 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
124 $ilAtomQuery->addTableLock(
'object_data');
125 $this->assertEquals(array(), $ilAtomQuery->getRisks());
131 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
138 $this->assertFalse($ilAtomQuery->checkCallable(
function () {
140 $this->assertFalse($ilAtomQuery->checkCallable(
function (
ilDBInterface $ilDBInterface, $someOtherParameter) {
142 $this->assertFalse($ilAtomQuery->checkCallable(
function ($someOtherParameter,
ilDBInterface $ilDBInterface) {
146 $this->assertFalse($ilAtomQuery->checkCallable(
function ($ilDBInterface) {
152 $this->assertFalse($ilAtomQuery->checkCallable(
'noClosure'));
158 $this->setExpectedException(
'ilDatabaseException');
160 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
174 if ($counter < $max) {
178 $result = $ilDBInterface->listTables();
181 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
182 $ilAtomQuery->addQueryCallable(
$query);
183 $ilAtomQuery->addTableLock(
'object_data');
185 $this->assertTrue(is_array(
$result));
196 if ($counter < $max) {
200 $result = $ilDBInterface->listTables();
203 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
204 $ilAtomQuery->addQueryCallable(
$query);
205 $ilAtomQuery->addTableLock(
'object_data');
209 $this->assertTrue(is_null(
$result));
216 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
224 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
225 $ilAtomQuery->addTableLock(
'object_data');
233 $ilAtomQuery = $this->ilDBInterfaceGalera->buildAtomQuery();
234 $ilAtomQuery->addTableLock(
'object_data');
235 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
237 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
245 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
246 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
247 $ilAtomQuery->addTableLock(
'il_db_tests_atom');
248 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
257 $ilAtomQuery = $this->ilDBInterfaceInnoDB->buildAtomQuery();
258 $ilAtomQuery->addTableLock(
'il_db_tests_atom')->aliasName(
'alias_one');
259 $ilAtomQuery->addTableLock(
'il_db_tests_atom')->aliasName(
'alias_one');
260 $ilAtomQuery->addQueryCallable(
function (
ilDBInterface $ilDBInterface) {
const DB_ATOM_CLOSURE_NONE
Class ilAtomQueryTransaction.
const ISOLATION_SERIALIZABLE
static checkAnomaly($anomalie)
TestCase for the ilDatabaseAtomBaseTest.
static getWrapper($a_type)
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()