MediaWiki
1.33.0
|
Test the parts of the Database abstract class that deal with creating SQL text. More...
Public Member Functions | |
provideBuildSubstring () | |
provideBuildSubstring_invalidParams () | |
testAtomicSections () | |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection More... | |
testAtomicSectionsCallbackCancellation () | |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection More... | |
testAtomicSectionsRecovery () | |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection More... | |
testAtomicSectionsTrxRound () | |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection More... | |
testBuildConcat ( $stringList, $sqlText) | |
provideBuildConcat Wikimedia\Rdbms\Database::buildConcat More... | |
testBuildIntegerCast () | |
\Wikimedia\Rdbms\Database::buildIntegerCast More... | |
testBuildLike ( $array, $sqlText) | |
provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal More... | |
testBuildSubstring ( $input, $start, $length, $expected) | |
Wikimedia\Rdbms\Database::buildSubstring provideBuildSubstring. More... | |
testBuildSubstring_invalidParams ( $start, $length) | |
Wikimedia\Rdbms\Database::buildSubstring Wikimedia\Rdbms\Database::assertBuildSubstringParams provideBuildSubstring_invalidParams. More... | |
testConditional ( $sql, $sqlText) | |
provideConditional Wikimedia\Rdbms\Database::conditional More... | |
testDelete ( $sql, $sqlText) | |
provideDelete Wikimedia\Rdbms\Database::delete More... | |
testDeleteJoin ( $sql, $sqlText) | |
provideDeleteJoin Wikimedia\Rdbms\Database::deleteJoin More... | |
testDropNonExistingTable () | |
Wikimedia\Rdbms\Database::dropTable. More... | |
testDropTable () | |
Wikimedia\Rdbms\Database::dropTable. More... | |
testImplicitTransactionRollback () | |
\Wikimedia\Rdbms\Database::query More... | |
testInsert ( $sql, $sqlText) | |
provideInsert Wikimedia\Rdbms\Database::insert Wikimedia\Rdbms\Database::makeInsertOptions More... | |
testInsertSelect ( $sql, $sqlTextNative, $sqlSelect, $sqlInsert) | |
provideInsertSelect Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect More... | |
testInsertSelectBatching () | |
Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect. More... | |
testInvalidAtomicSectionEnded ( $method) | |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic More... | |
testLockForUpdate ( $sql, $sqlText) | |
provideLockForUpdate Wikimedia\Rdbms\Database::lockForUpdate More... | |
testMakeList ( $list, $mode, $sqlText) | |
provideMakeList Wikimedia\Rdbms\Database::makeList More... | |
testNativeReplace ( $sql, $sqlText) | |
provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace More... | |
testNoAtomicSection ( $method) | |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic More... | |
testPrematureClose1 () | |
\Wikimedia\Rdbms\Database::close More... | |
testPrematureClose2 () | |
\Wikimedia\Rdbms\Database::close More... | |
testPrematureClose3 () | |
\Wikimedia\Rdbms\Database::close More... | |
testPrematureClose4 () | |
\Wikimedia\Rdbms\Database::close More... | |
testReplace ( $sql, $sqlText) | |
provideReplace Wikimedia\Rdbms\Database::replace More... | |
testSelect ( $sql, $sqlText) | |
provideSelect Wikimedia\Rdbms\Database::select Wikimedia\Rdbms\Database::selectSQLText Wikimedia\Rdbms\Database::tableNamesWithIndexClauseOrJOIN Wikimedia\Rdbms\Database::useIndexClause Wikimedia\Rdbms\Database::ignoreIndexClause Wikimedia\Rdbms\Database::makeSelectOptions Wikimedia\Rdbms\Database::makeOrderBy Wikimedia\Rdbms\Database::makeGroupByWithHaving Wikimedia\Rdbms\Database::selectFieldsOrOptionsAggregate Wikimedia\Rdbms\Database::selectOptionsIncludeLocking More... | |
testSelectFieldValues () | |
Wikimedia\Rdbms\Database::selectFieldValues() More... | |
testSelectRowCount ( $sql, $sqlText) | |
Wikimedia\Rdbms\Subquery provideSelectRowCount. More... | |
testSessionTempTables () | |
Wikimedia\Rdbms\Database::registerTempTableWrite. More... | |
testTransactionCommit () | |
Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit. More... | |
testTransactionErrorState1 () | |
\Wikimedia\Rdbms\DBTransactionStateError \Wikimedia\Rdbms\Database::assertTransactionStatus More... | |
testTransactionErrorState2 () | |
\Wikimedia\Rdbms\Database::query More... | |
testTransactionRollback () | |
Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback. More... | |
testTransactionStatementRollbackIgnoring () | |
\Wikimedia\Rdbms\Database::query More... | |
testUncancellableAtomicSection () | |
\Wikimedia\Rdbms\Database::cancelAtomic More... | |
testUnionConditionPermutations ( $params, $expect) | |
provideUnionConditionPermutations Wikimedia\Rdbms\Database::unionConditionPermutations More... | |
testUnionQueries ( $sql, $sqlText) | |
provideUnionQueries Wikimedia\Rdbms\Database::unionQueries More... | |
testUpdate ( $sql, $sqlText) | |
provideUpdate Wikimedia\Rdbms\Database::update Wikimedia\Rdbms\Database::makeUpdateOptions Wikimedia\Rdbms\Database::makeUpdateOptionsArray More... | |
testUpsert ( $sql, $sqlText) | |
provideUpsert Wikimedia\Rdbms\Database::upsert More... | |
Static Public Member Functions | |
static | provideAtomicSectionMethodsForErrors () |
static | provideBuildConcat () |
static | provideBuildLike () |
static | provideConditional () |
static | provideDelete () |
static | provideDeleteJoin () |
static | provideInsert () |
static | provideInsertSelect () |
static | provideLockForUpdate () |
static | provideMakeList () |
static | provideNativeReplace () |
static | provideReplace () |
static | provideSelect () |
static | provideSelectRowCount () |
static | provideUnionConditionPermutations () |
static | provideUnionQueries () |
static | provideUpdate () |
static | provideUpsert () |
Protected Member Functions | |
assertLastSql ( $sqlText) | |
assertLastSqlDb ( $sqlText, DatabaseTestHelper $db) | |
setUp () | |
Private Attributes | |
DatabaseTestHelper Database | $database |
Test the parts of the Database abstract class that deal with creating SQL text.
Definition at line 15 of file DatabaseSQLTest.php.
|
protected |
Definition at line 28 of file DatabaseSQLTest.php.
Referenced by testAtomicSections(), testAtomicSectionsCallbackCancellation(), testAtomicSectionsRecovery(), testAtomicSectionsTrxRound(), testDelete(), testDeleteJoin(), testDropTable(), testImplicitTransactionRollback(), testInsert(), testInsertSelect(), testLockForUpdate(), testNativeReplace(), testPrematureClose1(), testPrematureClose2(), testPrematureClose3(), testPrematureClose4(), testReplace(), testSelect(), testSelectFieldValues(), testSelectRowCount(), testTransactionCommit(), testTransactionErrorState2(), testTransactionRollback(), testTransactionStatementRollbackIgnoring(), testUpdate(), and testUpsert().
|
protected |
Definition at line 35 of file DatabaseSQLTest.php.
References DatabaseTestHelper\getLastSqls().
Referenced by testInsertSelect(), and testInsertSelectBatching().
|
static |
Definition at line 1819 of file DatabaseSQLTest.php.
|
static |
Definition at line 964 of file DatabaseSQLTest.php.
|
static |
Definition at line 988 of file DatabaseSQLTest.php.
DatabaseSQLTest::provideBuildSubstring | ( | ) |
Definition at line 1386 of file DatabaseSQLTest.php.
DatabaseSQLTest::provideBuildSubstring_invalidParams | ( | ) |
Definition at line 1400 of file DatabaseSQLTest.php.
|
static |
Definition at line 925 of file DatabaseSQLTest.php.
|
static |
Definition at line 473 of file DatabaseSQLTest.php.
|
static |
Definition at line 545 of file DatabaseSQLTest.php.
|
static |
Definition at line 591 of file DatabaseSQLTest.php.
|
static |
Definition at line 665 of file DatabaseSQLTest.php.
|
static |
Definition at line 277 of file DatabaseSQLTest.php.
|
static |
Definition at line 1275 of file DatabaseSQLTest.php.
References LIST_AND, LIST_COMMA, LIST_NAMES, LIST_OR, LIST_SET, and null.
|
static |
Definition at line 899 of file DatabaseSQLTest.php.
|
static |
Definition at line 785 of file DatabaseSQLTest.php.
|
static |
Definition at line 64 of file DatabaseSQLTest.php.
References true.
|
static |
Definition at line 329 of file DatabaseSQLTest.php.
|
static |
Definition at line 1079 of file DatabaseSQLTest.php.
References null.
|
static |
Definition at line 1032 of file DatabaseSQLTest.php.
|
static |
Definition at line 423 of file DatabaseSQLTest.php.
|
static |
Definition at line 508 of file DatabaseSQLTest.php.
|
protected |
Definition at line 23 of file DatabaseSQLTest.php.
DatabaseSQLTest::testAtomicSections | ( | ) |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection
Definition at line 1436 of file DatabaseSQLTest.php.
References $fname, assertLastSql(), and use.
DatabaseSQLTest::testAtomicSectionsCallbackCancellation | ( | ) |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection
Definition at line 1678 of file DatabaseSQLTest.php.
References $e, $fname, assertLastSql(), and use.
DatabaseSQLTest::testAtomicSectionsRecovery | ( | ) |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection
Definition at line 1623 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testAtomicSectionsTrxRound | ( | ) |
\Wikimedia\Rdbms\Database::doSavepoint \Wikimedia\Rdbms\Database::doReleaseSavepoint \Wikimedia\Rdbms\Database::doRollbackToSavepoint \Wikimedia\Rdbms\Database::startAtomic \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic \Wikimedia\Rdbms\Database::doAtomicSection
Definition at line 1809 of file DatabaseSQLTest.php.
References assertLastSql(), and DBO_TRX.
DatabaseSQLTest::testBuildConcat | ( | $stringList, | |
$sqlText | |||
) |
provideBuildConcat Wikimedia\Rdbms\Database::buildConcat
Definition at line 958 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildIntegerCast | ( | ) |
\Wikimedia\Rdbms\Database::buildIntegerCast
Definition at line 1422 of file DatabaseSQLTest.php.
References $output.
DatabaseSQLTest::testBuildLike | ( | $array, | |
$sqlText | |||
) |
provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal
Definition at line 982 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildSubstring | ( | $input, | |
$start, | |||
$length, | |||
$expected | |||
) |
Wikimedia\Rdbms\Database::buildSubstring provideBuildSubstring.
Definition at line 1395 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildSubstring_invalidParams | ( | $start, | |
$length | |||
) |
Wikimedia\Rdbms\Database::buildSubstring Wikimedia\Rdbms\Database::assertBuildSubstringParams provideBuildSubstring_invalidParams.
Definition at line 1414 of file DatabaseSQLTest.php.
References class.
DatabaseSQLTest::testConditional | ( | $sql, | |
$sqlText | |||
) |
provideConditional Wikimedia\Rdbms\Database::conditional
Definition at line 917 of file DatabaseSQLTest.php.
DatabaseSQLTest::testDelete | ( | $sql, | |
$sqlText | |||
) |
provideDelete Wikimedia\Rdbms\Database::delete
Definition at line 464 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testDeleteJoin | ( | $sql, | |
$sqlText | |||
) |
provideDeleteJoin Wikimedia\Rdbms\Database::deleteJoin
Definition at line 533 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testDropNonExistingTable | ( | ) |
Wikimedia\Rdbms\Database::dropTable.
Definition at line 1259 of file DatabaseSQLTest.php.
DatabaseSQLTest::testDropTable | ( | ) |
Wikimedia\Rdbms\Database::dropTable.
Definition at line 1250 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testImplicitTransactionRollback | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1940 of file DatabaseSQLTest.php.
References $e, assertLastSql(), and DBO_TRX.
DatabaseSQLTest::testInsert | ( | $sql, | |
$sqlText | |||
) |
provideInsert Wikimedia\Rdbms\Database::insert Wikimedia\Rdbms\Database::makeInsertOptions
Definition at line 581 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testInsertSelect | ( | $sql, | |
$sqlTextNative, | |||
$sqlSelect, | |||
$sqlInsert | |||
) |
provideInsertSelect Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect
Definition at line 635 of file DatabaseSQLTest.php.
References assertLastSql(), and assertLastSqlDb().
DatabaseSQLTest::testInsertSelectBatching | ( | ) |
Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect.
Definition at line 747 of file DatabaseSQLTest.php.
References $rows, and assertLastSqlDb().
DatabaseSQLTest::testInvalidAtomicSectionEnded | ( | $method | ) |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1848 of file DatabaseSQLTest.php.
DatabaseSQLTest::testLockForUpdate | ( | $sql, | |
$sqlText | |||
) |
provideLockForUpdate Wikimedia\Rdbms\Database::lockForUpdate
Definition at line 263 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testMakeList | ( | $list, | |
$mode, | |||
$sqlText | |||
) |
provideMakeList Wikimedia\Rdbms\Database::makeList
Definition at line 1269 of file DatabaseSQLTest.php.
DatabaseSQLTest::testNativeReplace | ( | $sql, | |
$sqlText | |||
) |
provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace
Definition at line 890 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testNoAtomicSection | ( | $method | ) |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1831 of file DatabaseSQLTest.php.
DatabaseSQLTest::testPrematureClose1 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2059 of file DatabaseSQLTest.php.
References $fname, assertLastSql(), and use.
DatabaseSQLTest::testPrematureClose2 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2087 of file DatabaseSQLTest.php.
References $fname, assertLastSql(), and use.
DatabaseSQLTest::testPrematureClose3 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2113 of file DatabaseSQLTest.php.
References assertLastSql(), and DBO_TRX.
DatabaseSQLTest::testPrematureClose4 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2136 of file DatabaseSQLTest.php.
References assertLastSql(), and DBO_TRX.
DatabaseSQLTest::testReplace | ( | $sql, | |
$sqlText | |||
) |
provideReplace Wikimedia\Rdbms\Database::replace
Definition at line 775 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSelect | ( | $sql, | |
$sqlText | |||
) |
provideSelect Wikimedia\Rdbms\Database::select Wikimedia\Rdbms\Database::selectSQLText Wikimedia\Rdbms\Database::tableNamesWithIndexClauseOrJOIN Wikimedia\Rdbms\Database::useIndexClause Wikimedia\Rdbms\Database::ignoreIndexClause Wikimedia\Rdbms\Database::makeSelectOptions Wikimedia\Rdbms\Database::makeOrderBy Wikimedia\Rdbms\Database::makeGroupByWithHaving Wikimedia\Rdbms\Database::selectFieldsOrOptionsAggregate Wikimedia\Rdbms\Database::selectOptionsIncludeLocking
Definition at line 52 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSelectFieldValues | ( | ) |
Wikimedia\Rdbms\Database::selectFieldValues()
Definition at line 2151 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSelectRowCount | ( | $sql, | |
$sqlText | |||
) |
Wikimedia\Rdbms\Subquery provideSelectRowCount.
array | $sql | |
string | $sqlText |
Definition at line 317 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSessionTempTables | ( | ) |
Wikimedia\Rdbms\Database::registerTempTableWrite.
Definition at line 1348 of file DatabaseSQLTest.php.
DatabaseSQLTest::testTransactionCommit | ( | ) |
Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit.
Definition at line 1231 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionErrorState1 | ( | ) |
\Wikimedia\Rdbms\DBTransactionStateError \Wikimedia\Rdbms\Database::assertTransactionStatus
Definition at line 1883 of file DatabaseSQLTest.php.
DatabaseSQLTest::testTransactionErrorState2 | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1895 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionRollback | ( | ) |
Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback.
Definition at line 1241 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionStatementRollbackIgnoring | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1994 of file DatabaseSQLTest.php.
References $e, assertLastSql(), and use.
DatabaseSQLTest::testUncancellableAtomicSection | ( | ) |
\Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1865 of file DatabaseSQLTest.php.
DatabaseSQLTest::testUnionConditionPermutations | ( | $params, | |
$expect | |||
) |
provideUnionConditionPermutations Wikimedia\Rdbms\Database::unionConditionPermutations
Definition at line 1062 of file DatabaseSQLTest.php.
References $params.
DatabaseSQLTest::testUnionQueries | ( | $sql, | |
$sqlText | |||
) |
provideUnionQueries Wikimedia\Rdbms\Database::unionQueries
Definition at line 1025 of file DatabaseSQLTest.php.
DatabaseSQLTest::testUpdate | ( | $sql, | |
$sqlText | |||
) |
provideUpdate Wikimedia\Rdbms\Database::update Wikimedia\Rdbms\Database::makeUpdateOptions Wikimedia\Rdbms\Database::makeUpdateOptionsArray
Definition at line 412 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testUpsert | ( | $sql, | |
$sqlText | |||
) |
provideUpsert Wikimedia\Rdbms\Database::upsert
Definition at line 497 of file DatabaseSQLTest.php.
References assertLastSql().
|
private |
Definition at line 21 of file DatabaseSQLTest.php.