MediaWiki REL1_31
|
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 | |
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 | |
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 | |
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 | |
testBuildConcat ( $stringList, $sqlText) | |
provideBuildConcat Wikimedia\Rdbms\Database::buildConcat | |
testBuildIntegerCast () | |
\Wikimedia\Rdbms\Database::buildIntegerCast | |
testBuildLike ( $array, $sqlText) | |
provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal | |
testBuildSubstring ( $input, $start, $length, $expected) | |
Wikimedia\Rdbms\Database::buildSubstring provideBuildSubstring. | |
testBuildSubstring_invalidParams ( $start, $length) | |
Wikimedia\Rdbms\Database::buildSubstring Wikimedia\Rdbms\Database::assertBuildSubstringParams provideBuildSubstring_invalidParams. | |
testConditional ( $sql, $sqlText) | |
provideConditional Wikimedia\Rdbms\Database::conditional | |
testDelete ( $sql, $sqlText) | |
provideDelete Wikimedia\Rdbms\Database::delete | |
testDeleteJoin ( $sql, $sqlText) | |
provideDeleteJoin Wikimedia\Rdbms\Database::deleteJoin | |
testDropNonExistingTable () | |
Wikimedia\Rdbms\Database::dropTable. | |
testDropTable () | |
Wikimedia\Rdbms\Database::dropTable. | |
testImplicitTransactionRollback () | |
\Wikimedia\Rdbms\Database::query | |
testInsert ( $sql, $sqlText) | |
provideInsert Wikimedia\Rdbms\Database::insert Wikimedia\Rdbms\Database::makeInsertOptions | |
testInsertSelect ( $sql, $sqlTextNative, $sqlSelect, $sqlInsert) | |
provideInsertSelect Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect | |
testInsertSelectBatching () | |
testInvalidAtomicSectionEnded ( $method) | |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic | |
testMakeList ( $list, $mode, $sqlText) | |
provideMakeList Wikimedia\Rdbms\Database::makeList | |
testNativeReplace ( $sql, $sqlText) | |
provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace | |
testNoAtomicSection ( $method) | |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic | |
testPrematureClose1 () | |
\Wikimedia\Rdbms\Database::close | |
testPrematureClose2 () | |
\Wikimedia\Rdbms\Database::close | |
testPrematureClose3 () | |
\Wikimedia\Rdbms\Database::close | |
testPrematureClose4 () | |
\Wikimedia\Rdbms\Database::close | |
testReplace ( $sql, $sqlText) | |
provideReplace Wikimedia\Rdbms\Database::replace | |
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 | |
testSelectFieldValues () | |
Wikimedia\Rdbms\Database::selectFieldValues() | |
testSelectRowCount ( $sql, $sqlText) | |
Wikimedia\Rdbms\Subquery provideSelectRowCount. | |
testSessionTempTables () | |
Wikimedia\Rdbms\Database::registerTempTableOperation. | |
testTransactionCommit () | |
Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit. | |
testTransactionErrorState1 () | |
\Wikimedia\Rdbms\DBTransactionStateError | |
testTransactionErrorState2 () | |
\Wikimedia\Rdbms\Database::query | |
testTransactionRollback () | |
Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback. | |
testTransactionStatementRollbackIgnoring () | |
\Wikimedia\Rdbms\Database::query | |
testUncancellableAtomicSection () | |
\Wikimedia\Rdbms\Database::cancelAtomic | |
testUnionConditionPermutations ( $params, $expect) | |
provideUnionConditionPermutations Wikimedia\Rdbms\Database::unionConditionPermutations | |
testUnionQueries ( $sql, $sqlText) | |
provideUnionQueries Wikimedia\Rdbms\Database::unionQueries | |
testUpdate ( $sql, $sqlText) | |
provideUpdate Wikimedia\Rdbms\Database::update Wikimedia\Rdbms\Database::makeUpdateOptions Wikimedia\Rdbms\Database::makeUpdateOptionsArray | |
testUpsert ( $sql, $sqlText) | |
provideUpsert Wikimedia\Rdbms\Database::upsert | |
Static Public Member Functions | |
static | provideAtomicSectionMethodsForErrors () |
static | provideBuildConcat () |
static | provideBuildLike () |
static | provideConditional () |
static | provideDelete () |
static | provideDeleteJoin () |
static | provideInsert () |
static | provideInsertSelect () |
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(), 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 1750 of file DatabaseSQLTest.php.
|
static |
Definition at line 898 of file DatabaseSQLTest.php.
|
static |
Definition at line 922 of file DatabaseSQLTest.php.
DatabaseSQLTest::provideBuildSubstring | ( | ) |
Definition at line 1320 of file DatabaseSQLTest.php.
DatabaseSQLTest::provideBuildSubstring_invalidParams | ( | ) |
Definition at line 1334 of file DatabaseSQLTest.php.
|
static |
Definition at line 859 of file DatabaseSQLTest.php.
|
static |
Definition at line 411 of file DatabaseSQLTest.php.
|
static |
Definition at line 483 of file DatabaseSQLTest.php.
|
static |
Definition at line 529 of file DatabaseSQLTest.php.
|
static |
Definition at line 603 of file DatabaseSQLTest.php.
|
static |
Definition at line 1209 of file DatabaseSQLTest.php.
References LIST_AND, LIST_COMMA, LIST_NAMES, LIST_OR, and LIST_SET.
|
static |
Definition at line 833 of file DatabaseSQLTest.php.
|
static |
Definition at line 719 of file DatabaseSQLTest.php.
|
static |
Definition at line 62 of file DatabaseSQLTest.php.
References true.
|
static |
Definition at line 267 of file DatabaseSQLTest.php.
|
static |
Definition at line 1013 of file DatabaseSQLTest.php.
|
static |
Definition at line 966 of file DatabaseSQLTest.php.
|
static |
Definition at line 361 of file DatabaseSQLTest.php.
|
static |
Definition at line 446 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 1370 of file DatabaseSQLTest.php.
References $fname, and assertLastSql().
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 1609 of file DatabaseSQLTest.php.
References $e, $fname, and assertLastSql().
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 1554 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 1740 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testBuildConcat | ( | $stringList, | |
$sqlText ) |
provideBuildConcat Wikimedia\Rdbms\Database::buildConcat
Definition at line 892 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildIntegerCast | ( | ) |
\Wikimedia\Rdbms\Database::buildIntegerCast
Definition at line 1356 of file DatabaseSQLTest.php.
References $output.
DatabaseSQLTest::testBuildLike | ( | $array, | |
$sqlText ) |
provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal
Definition at line 916 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildSubstring | ( | $input, | |
$start, | |||
$length, | |||
$expected ) |
Wikimedia\Rdbms\Database::buildSubstring provideBuildSubstring.
Definition at line 1329 of file DatabaseSQLTest.php.
DatabaseSQLTest::testBuildSubstring_invalidParams | ( | $start, | |
$length ) |
Wikimedia\Rdbms\Database::buildSubstring Wikimedia\Rdbms\Database::assertBuildSubstringParams provideBuildSubstring_invalidParams.
Definition at line 1348 of file DatabaseSQLTest.php.
DatabaseSQLTest::testConditional | ( | $sql, | |
$sqlText ) |
provideConditional Wikimedia\Rdbms\Database::conditional
Definition at line 851 of file DatabaseSQLTest.php.
DatabaseSQLTest::testDelete | ( | $sql, | |
$sqlText ) |
provideDelete Wikimedia\Rdbms\Database::delete
Definition at line 402 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testDeleteJoin | ( | $sql, | |
$sqlText ) |
provideDeleteJoin Wikimedia\Rdbms\Database::deleteJoin
Definition at line 471 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testDropNonExistingTable | ( | ) |
Wikimedia\Rdbms\Database::dropTable.
Definition at line 1193 of file DatabaseSQLTest.php.
DatabaseSQLTest::testDropTable | ( | ) |
Wikimedia\Rdbms\Database::dropTable.
Definition at line 1184 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testImplicitTransactionRollback | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1870 of file DatabaseSQLTest.php.
References $e, and assertLastSql().
DatabaseSQLTest::testInsert | ( | $sql, | |
$sqlText ) |
provideInsert Wikimedia\Rdbms\Database::insert Wikimedia\Rdbms\Database::makeInsertOptions
Definition at line 519 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testInsertSelect | ( | $sql, | |
$sqlTextNative, | |||
$sqlSelect, | |||
$sqlInsert ) |
provideInsertSelect Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect
Definition at line 573 of file DatabaseSQLTest.php.
References assertLastSql(), and assertLastSqlDb().
DatabaseSQLTest::testInsertSelectBatching | ( | ) |
Definition at line 681 of file DatabaseSQLTest.php.
References $rows, and assertLastSqlDb().
DatabaseSQLTest::testInvalidAtomicSectionEnded | ( | $method | ) |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1779 of file DatabaseSQLTest.php.
DatabaseSQLTest::testMakeList | ( | $list, | |
$mode, | |||
$sqlText ) |
provideMakeList Wikimedia\Rdbms\Database::makeList
Definition at line 1203 of file DatabaseSQLTest.php.
DatabaseSQLTest::testNativeReplace | ( | $sql, | |
$sqlText ) |
provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace
Definition at line 824 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testNoAtomicSection | ( | $method | ) |
provideAtomicSectionMethodsForErrors \Wikimedia\Rdbms\Database::endAtomic \Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1762 of file DatabaseSQLTest.php.
DatabaseSQLTest::testPrematureClose1 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 1973 of file DatabaseSQLTest.php.
References $fname, and assertLastSql().
DatabaseSQLTest::testPrematureClose2 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 1990 of file DatabaseSQLTest.php.
References $fname, and assertLastSql().
DatabaseSQLTest::testPrematureClose3 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2016 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testPrematureClose4 | ( | ) |
\Wikimedia\Rdbms\Database::close
Definition at line 2039 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testReplace | ( | $sql, | |
$sqlText ) |
provideReplace Wikimedia\Rdbms\Database::replace
Definition at line 709 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
Definition at line 50 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSelectFieldValues | ( | ) |
Wikimedia\Rdbms\Database::selectFieldValues()
Definition at line 2054 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSelectRowCount | ( | $sql, | |
$sqlText ) |
Wikimedia\Rdbms\Subquery provideSelectRowCount.
$sql | |
$sqlText |
Definition at line 255 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testSessionTempTables | ( | ) |
Wikimedia\Rdbms\Database::registerTempTableOperation.
Definition at line 1282 of file DatabaseSQLTest.php.
DatabaseSQLTest::testTransactionCommit | ( | ) |
Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit.
Definition at line 1165 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionErrorState1 | ( | ) |
\Wikimedia\Rdbms\DBTransactionStateError
Definition at line 1813 of file DatabaseSQLTest.php.
DatabaseSQLTest::testTransactionErrorState2 | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1825 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionRollback | ( | ) |
Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback.
Definition at line 1175 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testTransactionStatementRollbackIgnoring | ( | ) |
\Wikimedia\Rdbms\Database::query
Definition at line 1908 of file DatabaseSQLTest.php.
References $e, and assertLastSql().
DatabaseSQLTest::testUncancellableAtomicSection | ( | ) |
\Wikimedia\Rdbms\Database::cancelAtomic
Definition at line 1796 of file DatabaseSQLTest.php.
DatabaseSQLTest::testUnionConditionPermutations | ( | $params, | |
$expect ) |
provideUnionConditionPermutations Wikimedia\Rdbms\Database::unionConditionPermutations
Definition at line 996 of file DatabaseSQLTest.php.
References $params.
DatabaseSQLTest::testUnionQueries | ( | $sql, | |
$sqlText ) |
provideUnionQueries Wikimedia\Rdbms\Database::unionQueries
Definition at line 959 of file DatabaseSQLTest.php.
DatabaseSQLTest::testUpdate | ( | $sql, | |
$sqlText ) |
provideUpdate Wikimedia\Rdbms\Database::update Wikimedia\Rdbms\Database::makeUpdateOptions Wikimedia\Rdbms\Database::makeUpdateOptionsArray
Definition at line 350 of file DatabaseSQLTest.php.
References assertLastSql().
DatabaseSQLTest::testUpsert | ( | $sql, | |
$sqlText ) |
provideUpsert Wikimedia\Rdbms\Database::upsert
Definition at line 435 of file DatabaseSQLTest.php.
References assertLastSql().
|
private |
Definition at line 21 of file DatabaseSQLTest.php.