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

Public Member Functions

 testAddQuotes ( $input, $expected)
 provideAddQuotes Wikimedia\Rdbms\Database::addQuotes More...
 
 testFlagSetting ()
 Wikimedia\Rdbms\Database::getFlag Wikimedia\Rdbms\Database::setFlag Wikimedia\Rdbms\Database::restoreFlags. More...
 
 testFlushSnapshot ()
 Wikimedia\Rdbms\Database::flushSnapshot. More...
 
 testGetScopedLock ()
 
 testMutators ()
 Wikimedia\Rdbms\Database::tablePrefix Wikimedia\Rdbms\Database::dbSchema. More...
 
 testTableName ( $expected, $table, $format, array $alias=null)
 provideTableName Wikimedia\Rdbms\Database::tableName More...
 
 testTransactionIdle ()
 Wikimedia\Rdbms\Database::onTransactionIdle Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks. More...
 
 testTransactionListener ()
 Wikimedia\Rdbms\Database::setTransactionListener. More...
 
 testTransactionPreCommitOrIdle ()
 Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks. More...
 
 testTransactionPreCommitOrIdle_TRX ()
 Wikimedia\Rdbms\Database::onTransactionPreCommitOrIdle Wikimedia\Rdbms\Database::runOnTransactionPreCommitCallbacks. More...
 
 testTransactionResolution ()
 Wikimedia\Rdbms\Database::onTransactionResolution Wikimedia\Rdbms\Database::runOnTransactionIdleCallbacks. More...
 

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. More...
 

Detailed Description

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

References class.

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

◆ provideAddQuotes()

static DatabaseTest::provideAddQuotes ( )
static

Definition at line 14 of file DatabaseTest.php.

◆ provideTableName()

static DatabaseTest::provideTableName ( )
static

Definition at line 32 of file DatabaseTest.php.

◆ setUp()

DatabaseTest::setUp ( )
protected

Definition at line 10 of file DatabaseTest.php.

◆ testAddQuotes()

DatabaseTest::testAddQuotes (   $input,
  $expected 
)

provideAddQuotes Wikimedia\Rdbms\Database::addQuotes

Definition at line 28 of file DatabaseTest.php.

References $input.

◆ testFlagSetting()

DatabaseTest::testFlagSetting ( )

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

Definition at line 365 of file DatabaseTest.php.

References DBO_SSL, and DBO_TRX.

◆ testFlushSnapshot()

DatabaseTest::testFlushSnapshot ( )

Wikimedia\Rdbms\Database::flushSnapshot.

Definition at line 309 of file DatabaseTest.php.

References DBO_TRX, and getMockDB().

◆ testGetScopedLock()

DatabaseTest::testGetScopedLock ( )

◆ testMutators()

DatabaseTest::testMutators ( )

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

Definition at line 404 of file DatabaseTest.php.

◆ testTableName()

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

provideTableName Wikimedia\Rdbms\Database::tableName

Definition at line 87 of file DatabaseTest.php.

◆ testTransactionIdle()

DatabaseTest::testTransactionIdle ( )

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

Definition at line 101 of file DatabaseTest.php.

References DBO_TRX, and use.

◆ testTransactionListener()

DatabaseTest::testTransactionListener ( )

Wikimedia\Rdbms\Database::setTransactionListener.

Definition at line 237 of file DatabaseTest.php.

References use.

◆ testTransactionPreCommitOrIdle()

DatabaseTest::testTransactionPreCommitOrIdle ( )

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

Definition at line 143 of file DatabaseTest.php.

References DBO_TRX, getMockDB(), and use.

◆ testTransactionPreCommitOrIdle_TRX()

DatabaseTest::testTransactionPreCommitOrIdle_TRX ( )

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

Definition at line 176 of file DatabaseTest.php.

References DBO_TRX, getMockDB(), and use.

◆ testTransactionResolution()

DatabaseTest::testTransactionResolution ( )

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

Definition at line 208 of file DatabaseTest.php.

References DBO_TRX, and use.


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