MediaWiki REL1_31
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.
 
 testMutators ()
 Wikimedia\Rdbms\Database::tablePrefix Wikimedia\Rdbms\Database::dbSchema.
 
 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::onTransactionIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.
 
 testTransactionIdle_TRX ()
 Wikimedia\Rdbms\Database::onTransactionIdle 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

 badLockingMethodExplicit (IDatabase $db)
 
 badLockingMethodImplicit (IDatabase $db)
 
 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 13 of file DatabaseTest.php.

Member Function Documentation

◆ badLockingMethodExplicit()

DatabaseTest::badLockingMethodExplicit ( IDatabase $db)
private

◆ badLockingMethodImplicit()

DatabaseTest::badLockingMethodImplicit ( IDatabase $db)
private

◆ 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 416 of file DatabaseTest.php.

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

◆ provideAddQuotes()

static DatabaseTest::provideAddQuotes ( )
static

Definition at line 44 of file DatabaseTest.php.

◆ provideTableName()

static DatabaseTest::provideTableName ( )
static

Definition at line 62 of file DatabaseTest.php.

◆ provideTableNamesWithIndexClauseOrJOIN()

DatabaseTest::provideTableNamesWithIndexClauseOrJOIN ( )

Definition at line 127 of file DatabaseTest.php.

◆ setUp()

DatabaseTest::setUp ( )
protected

Definition at line 17 of file DatabaseTest.php.

◆ testAddQuotes()

DatabaseTest::testAddQuotes ( $input,
$expected )

provideAddQuotes Wikimedia\Rdbms\Database::addQuotes

Definition at line 58 of file DatabaseTest.php.

References $input.

◆ testDBOIgnoreClear()

DatabaseTest::testDBOIgnoreClear ( )

UnexpectedValueException Wikimedia\Rdbms\Database::clearFlag.

Definition at line 582 of file DatabaseTest.php.

◆ testDBOIgnoreSet()

DatabaseTest::testDBOIgnoreSet ( )

UnexpectedValueException Wikimedia\Rdbms\Database::setFlag.

Definition at line 569 of file DatabaseTest.php.

◆ testFactory()

DatabaseTest::testFactory ( )

provideAddQuotes Wikimedia\Rdbms\Database::factory

Definition at line 25 of file DatabaseTest.php.

References false.

◆ testFlagSetting()

DatabaseTest::testFlagSetting ( )

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

Definition at line 530 of file DatabaseTest.php.

References DBO_SSL, and DBO_TRX.

◆ testFlushSnapshot()

DatabaseTest::testFlushSnapshot ( )

Wikimedia\Rdbms\Database::flushSnapshot.

Definition at line 450 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 472 of file DatabaseTest.php.

References $e, badLockingMethodExplicit(), badLockingMethodImplicit(), DBO_TRX, and getMockDB().

◆ testMutators()

DatabaseTest::testMutators ( )

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

Definition at line 595 of file DatabaseTest.php.

◆ testTableName()

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

provideTableName Wikimedia\Rdbms\Database::tableName

Definition at line 117 of file DatabaseTest.php.

◆ testTableNamesWithIndexClauseOrJOIN()

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

provideTableNamesWithIndexClauseOrJOIN Wikimedia\Rdbms\Database::tableNamesWithIndexClauseOrJOIN

Definition at line 167 of file DatabaseTest.php.

References $tables.

◆ testTransactionIdle()

DatabaseTest::testTransactionIdle ( )

Wikimedia\Rdbms\Database::onTransactionIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.

Definition at line 177 of file DatabaseTest.php.

References DBO_TRX.

◆ testTransactionIdle_TRX()

DatabaseTest::testTransactionIdle_TRX ( )

Wikimedia\Rdbms\Database::onTransactionIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.

Definition at line 218 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testTransactionListener()

DatabaseTest::testTransactionListener ( )

Wikimedia\Rdbms\Database::setTransactionListener.

Definition at line 378 of file DatabaseTest.php.

◆ testTransactionPreCommitOrIdle()

DatabaseTest::testTransactionPreCommitOrIdle ( )

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

Definition at line 268 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testTransactionPreCommitOrIdle_TRX()

DatabaseTest::testTransactionPreCommitOrIdle_TRX ( )

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

Definition at line 301 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testTransactionResolution()

DatabaseTest::testTransactionResolution ( )

Wikimedia\Rdbms\Database::onTransactionResolution Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks.

Definition at line 349 of file DatabaseTest.php.

References DBO_TRX.


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