MediaWiki REL1_32
DatabaseTest Class Reference
Inheritance diagram for DatabaseTest:
Collaboration diagram for DatabaseTest:

Public Member Functions

 provideTableNamesWithIndexClauseOrJOIN ()
 
 testAddQuotes ( $input, $expected)
 provideAddQuotes Wikimedia\Rdbms\Database::addQuotes
 
 testDBOIgnoreClear ()
 UnexpectedValueException Wikimedia\Rdbms\Database::clearFlag.
 
 testDBOIgnoreSet ()
 UnexpectedValueException Wikimedia\Rdbms\Database::setFlag.
 
 testFactory ()
 provideAddQuotes Wikimedia\Rdbms\Database::factory
 
 testFlagSetting ()
 Wikimedia\Rdbms\Database::getFlag Wikimedia\Rdbms\Database::setFlag Wikimedia\Rdbms\Database::restoreFlags.
 
 testFlushSnapshot ()
 Wikimedia\Rdbms\Database::flushSnapshot.
 
 testGetScopedLock ()
 Wikimedia\Rdbms\Database::getScopedLockAndFlush Wikimedia\Rdbms\Database::lock Wikimedia\Rdbms\Database::unlock Wikimedia\Rdbms\Database::lockIsFree.
 
 testSchemaAndPrefixMutators ()
 Wikimedia\Rdbms\Database::tablePrefix Wikimedia\Rdbms\Database::dbSchema.
 
 testSelectDomain ()
 Wikimedia\Rdbms\Database::selectDomain.
 
 testTableName ( $expected, $table, $format, array $alias=null)
 provideTableName Wikimedia\Rdbms\Database::tableName
 
 testTableNamesWithIndexClauseOrJOIN ( $tables, $join_conds, $expect)
 provideTableNamesWithIndexClauseOrJOIN Wikimedia\Rdbms\Database::tableNamesWithIndexClauseOrJOIN
 
 testTransactionIdle ()
 Wikimedia\Rdbms\Database::onTransactionCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.
 
 testTransactionIdle_TRX ()
 Wikimedia\Rdbms\Database::onTransactionCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.
 
 testTransactionListener ()
 Wikimedia\Rdbms\Database::setTransactionListener.
 
 testTransactionPreCommitOrIdle ()
 Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks.
 
 testTransactionPreCommitOrIdle_TRX ()
 Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks.
 
 testTransactionResolution ()
 Wikimedia\Rdbms\Database::onTransactionResolution Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.
 

Static Public Member Functions

static provideAddQuotes ()
 
static provideTableName ()
 

Protected Member Functions

 setUp ()
 

Private Member Functions

 getMockDB ( $methods=[])
 Use this mock instead of DatabaseTestHelper for cases where DatabaseTestHelper is too inflexibile due to mocking too much or being too restrictive about fname matching (e.g.
 

Detailed Description

Definition at line 15 of file DatabaseTest.php.

Member Function Documentation

◆ getMockDB()

DatabaseTest::getMockDB ( $methods = [])
private

Use this mock instead of DatabaseTestHelper for cases where DatabaseTestHelper is too inflexibile due to mocking too much or being too restrictive about fname matching (e.g.

for tests that assert behaviour when the name is a mismatch, we need to catch the error here instead of there).

Returns
Database

Definition at line 430 of file DatabaseTest.php.

Referenced by testFlushSnapshot(), testGetScopedLock(), testTransactionIdle_TRX(), testTransactionPreCommitOrIdle(), and testTransactionPreCommitOrIdle_TRX().

◆ provideAddQuotes()

static DatabaseTest::provideAddQuotes ( )
static

Definition at line 46 of file DatabaseTest.php.

◆ provideTableName()

static DatabaseTest::provideTableName ( )
static

Definition at line 64 of file DatabaseTest.php.

◆ provideTableNamesWithIndexClauseOrJOIN()

DatabaseTest::provideTableNamesWithIndexClauseOrJOIN ( )

Definition at line 129 of file DatabaseTest.php.

◆ setUp()

DatabaseTest::setUp ( )
protected

Definition at line 19 of file DatabaseTest.php.

◆ testAddQuotes()

DatabaseTest::testAddQuotes ( $input,
$expected )

provideAddQuotes Wikimedia\Rdbms\Database::addQuotes

Definition at line 60 of file DatabaseTest.php.

References $input.

◆ testDBOIgnoreClear()

DatabaseTest::testDBOIgnoreClear ( )

UnexpectedValueException Wikimedia\Rdbms\Database::clearFlag.

Definition at line 618 of file DatabaseTest.php.

◆ testDBOIgnoreSet()

DatabaseTest::testDBOIgnoreSet ( )

UnexpectedValueException Wikimedia\Rdbms\Database::setFlag.

Definition at line 605 of file DatabaseTest.php.

◆ testFactory()

DatabaseTest::testFactory ( )

provideAddQuotes Wikimedia\Rdbms\Database::factory

Definition at line 27 of file DatabaseTest.php.

References false.

◆ testFlagSetting()

DatabaseTest::testFlagSetting ( )

Wikimedia\Rdbms\Database::getFlag Wikimedia\Rdbms\Database::setFlag Wikimedia\Rdbms\Database::restoreFlags.

Definition at line 566 of file DatabaseTest.php.

References DBO_SSL, and DBO_TRX.

◆ testFlushSnapshot()

DatabaseTest::testFlushSnapshot ( )

Wikimedia\Rdbms\Database::flushSnapshot.

Definition at line 466 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testGetScopedLock()

DatabaseTest::testGetScopedLock ( )

Wikimedia\Rdbms\Database::getScopedLockAndFlush Wikimedia\Rdbms\Database::lock Wikimedia\Rdbms\Database::unlock Wikimedia\Rdbms\Database::lockIsFree.

Definition at line 488 of file DatabaseTest.php.

References $e, DBO_TRX, and getMockDB().

◆ testSchemaAndPrefixMutators()

DatabaseTest::testSchemaAndPrefixMutators ( )

Wikimedia\Rdbms\Database::tablePrefix Wikimedia\Rdbms\Database::dbSchema.

Definition at line 631 of file DatabaseTest.php.

◆ testSelectDomain()

DatabaseTest::testSelectDomain ( )

Wikimedia\Rdbms\Database::selectDomain.

Definition at line 656 of file DatabaseTest.php.

◆ testTableName()

DatabaseTest::testTableName ( $expected,
$table,
$format,
array $alias = null )

provideTableName Wikimedia\Rdbms\Database::tableName

Definition at line 119 of file DatabaseTest.php.

◆ testTableNamesWithIndexClauseOrJOIN()

DatabaseTest::testTableNamesWithIndexClauseOrJOIN ( $tables,
$join_conds,
$expect )

provideTableNamesWithIndexClauseOrJOIN Wikimedia\Rdbms\Database::tableNamesWithIndexClauseOrJOIN

Definition at line 169 of file DatabaseTest.php.

References $tables.

◆ testTransactionIdle()

DatabaseTest::testTransactionIdle ( )

Wikimedia\Rdbms\Database::onTransactionCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.

Definition at line 179 of file DatabaseTest.php.

References DBO_TRX, Wikimedia\Rdbms\IDatabase\getFlag(), and Wikimedia\Rdbms\IDatabase\setFlag().

◆ testTransactionIdle_TRX()

DatabaseTest::testTransactionIdle_TRX ( )

Wikimedia\Rdbms\Database::onTransactionCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.

Definition at line 220 of file DatabaseTest.php.

References $e, DBO_TRX, and getMockDB().

◆ testTransactionListener()

DatabaseTest::testTransactionListener ( )

Wikimedia\Rdbms\Database::setTransactionListener.

Definition at line 392 of file DatabaseTest.php.

◆ testTransactionPreCommitOrIdle()

DatabaseTest::testTransactionPreCommitOrIdle ( )

Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks.

Definition at line 281 of file DatabaseTest.php.

References Wikimedia\Rdbms\IDatabase\begin(), Wikimedia\Rdbms\IDatabase\commit(), DBO_TRX, getMockDB(), and Wikimedia\Rdbms\IDatabase\onTransactionPreCommitOrIdle().

◆ testTransactionPreCommitOrIdle_TRX()

DatabaseTest::testTransactionPreCommitOrIdle_TRX ( )

Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks.

Definition at line 314 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testTransactionResolution()


The documentation for this class was generated from the following file: