MediaWiki  1.30.0
DatabaseSQLTest Class Reference

Test the parts of the Database abstract class that deal with creating SQL text. More...

Inheritance diagram for DatabaseSQLTest:
Collaboration diagram for DatabaseSQLTest:

Public Member Functions

 testBuildConcat ( $stringList, $sqlText)
 provideBuildConcat Wikimedia\Rdbms\Database::buildConcat More...
 
 testBuildLike ( $array, $sqlText)
 provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal 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...
 
 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...
 
 testMakeList ( $list, $mode, $sqlText)
 provideMakeList Wikimedia\Rdbms\Database::makeList More...
 
 testNativeReplace ( $sql, $sqlText)
 provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace 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 More...
 
 testSessionTempTables ()
 Wikimedia\Rdbms\Database::registerTempTableOperation. More...
 
 testTransactionCommit ()
 Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit. More...
 
 testTransactionRollback ()
 Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback. 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 provideBuildConcat ()
 
static provideBuildLike ()
 
static provideConditional ()
 
static provideDelete ()
 
static provideDeleteJoin ()
 
static provideInsert ()
 
static provideInsertSelect ()
 
static provideMakeList ()
 
static provideNativeReplace ()
 
static provideReplace ()
 
static provideSelect ()
 
static provideUnionConditionPermutations ()
 
static provideUnionQueries ()
 
static provideUpdate ()
 
static provideUpsert ()
 

Protected Member Functions

 assertLastSql ( $sqlText)
 
 assertLastSqlDb ( $sqlText, DatabaseTestHelper $db)
 
 setUp ()
 

Private Attributes

DatabaseTestHelper $database
 

Detailed Description

Test the parts of the Database abstract class that deal with creating SQL text.

Definition at line 9 of file DatabaseSQLTest.php.

Member Function Documentation

◆ assertLastSql()

◆ assertLastSqlDb()

DatabaseSQLTest::assertLastSqlDb (   $sqlText,
DatabaseTestHelper  $db 
)
protected

Definition at line 25 of file DatabaseSQLTest.php.

References DatabaseTestHelper\getLastSqls().

Referenced by testInsertSelect().

◆ provideBuildConcat()

static DatabaseSQLTest::provideBuildConcat ( )
static

Definition at line 730 of file DatabaseSQLTest.php.

◆ provideBuildLike()

static DatabaseSQLTest::provideBuildLike ( )
static

Definition at line 754 of file DatabaseSQLTest.php.

◆ provideConditional()

static DatabaseSQLTest::provideConditional ( )
static

Definition at line 691 of file DatabaseSQLTest.php.

◆ provideDelete()

static DatabaseSQLTest::provideDelete ( )
static

Definition at line 268 of file DatabaseSQLTest.php.

◆ provideDeleteJoin()

static DatabaseSQLTest::provideDeleteJoin ( )
static

Definition at line 340 of file DatabaseSQLTest.php.

◆ provideInsert()

static DatabaseSQLTest::provideInsert ( )
static

Definition at line 386 of file DatabaseSQLTest.php.

◆ provideInsertSelect()

static DatabaseSQLTest::provideInsertSelect ( )
static

Definition at line 460 of file DatabaseSQLTest.php.

◆ provideMakeList()

static DatabaseSQLTest::provideMakeList ( )
static

Definition at line 1041 of file DatabaseSQLTest.php.

References LIST_AND, LIST_COMMA, LIST_NAMES, LIST_OR, and LIST_SET.

◆ provideNativeReplace()

static DatabaseSQLTest::provideNativeReplace ( )
static

Definition at line 665 of file DatabaseSQLTest.php.

◆ provideReplace()

static DatabaseSQLTest::provideReplace ( )
static

Definition at line 551 of file DatabaseSQLTest.php.

◆ provideSelect()

static DatabaseSQLTest::provideSelect ( )
static

Definition at line 52 of file DatabaseSQLTest.php.

References true.

◆ provideUnionConditionPermutations()

static DatabaseSQLTest::provideUnionConditionPermutations ( )
static

Definition at line 845 of file DatabaseSQLTest.php.

◆ provideUnionQueries()

static DatabaseSQLTest::provideUnionQueries ( )
static

Definition at line 798 of file DatabaseSQLTest.php.

◆ provideUpdate()

static DatabaseSQLTest::provideUpdate ( )
static

Definition at line 218 of file DatabaseSQLTest.php.

◆ provideUpsert()

static DatabaseSQLTest::provideUpsert ( )
static

Definition at line 303 of file DatabaseSQLTest.php.

◆ setUp()

DatabaseSQLTest::setUp ( )
protected

Definition at line 13 of file DatabaseSQLTest.php.

References database.

◆ testBuildConcat()

DatabaseSQLTest::testBuildConcat (   $stringList,
  $sqlText 
)

provideBuildConcat Wikimedia\Rdbms\Database::buildConcat

Definition at line 724 of file DatabaseSQLTest.php.

References database.

◆ testBuildLike()

DatabaseSQLTest::testBuildLike (   $array,
  $sqlText 
)

provideBuildLike Wikimedia\Rdbms\Database::buildLike Wikimedia\Rdbms\Database::escapeLikeInternal

Definition at line 748 of file DatabaseSQLTest.php.

References database.

◆ testConditional()

DatabaseSQLTest::testConditional (   $sql,
  $sqlText 
)

provideConditional Wikimedia\Rdbms\Database::conditional

Definition at line 683 of file DatabaseSQLTest.php.

References database.

◆ testDelete()

DatabaseSQLTest::testDelete (   $sql,
  $sqlText 
)

provideDelete Wikimedia\Rdbms\Database::delete

Definition at line 259 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testDeleteJoin()

DatabaseSQLTest::testDeleteJoin (   $sql,
  $sqlText 
)

provideDeleteJoin Wikimedia\Rdbms\Database::deleteJoin

Definition at line 328 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testDropNonExistingTable()

DatabaseSQLTest::testDropNonExistingTable ( )

Wikimedia\Rdbms\Database::dropTable.

Definition at line 1025 of file DatabaseSQLTest.php.

References database.

◆ testDropTable()

DatabaseSQLTest::testDropTable ( )

Wikimedia\Rdbms\Database::dropTable.

Definition at line 1016 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testInsert()

DatabaseSQLTest::testInsert (   $sql,
  $sqlText 
)

provideInsert Wikimedia\Rdbms\Database::insert Wikimedia\Rdbms\Database::makeInsertOptions

Definition at line 376 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testInsertSelect()

DatabaseSQLTest::testInsertSelect (   $sql,
  $sqlTextNative,
  $sqlSelect,
  $sqlInsert 
)

provideInsertSelect Wikimedia\Rdbms\Database::insertSelect Wikimedia\Rdbms\Database::nativeInsertSelect

Definition at line 430 of file DatabaseSQLTest.php.

References assertLastSql(), assertLastSqlDb(), and database.

◆ testMakeList()

DatabaseSQLTest::testMakeList (   $list,
  $mode,
  $sqlText 
)

provideMakeList Wikimedia\Rdbms\Database::makeList

Definition at line 1035 of file DatabaseSQLTest.php.

References database.

◆ testNativeReplace()

DatabaseSQLTest::testNativeReplace (   $sql,
  $sqlText 
)

provideNativeReplace Wikimedia\Rdbms\Database::nativeReplace

Definition at line 656 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testReplace()

DatabaseSQLTest::testReplace (   $sql,
  $sqlText 
)

provideReplace Wikimedia\Rdbms\Database::replace

Definition at line 541 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testSelect()

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 40 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testSessionTempTables()

DatabaseSQLTest::testSessionTempTables ( )

Wikimedia\Rdbms\Database::registerTempTableOperation.

Definition at line 1114 of file DatabaseSQLTest.php.

References database.

◆ testTransactionCommit()

DatabaseSQLTest::testTransactionCommit ( )

Wikimedia\Rdbms\Database::commit Wikimedia\Rdbms\Database::doCommit.

Definition at line 997 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testTransactionRollback()

DatabaseSQLTest::testTransactionRollback ( )

Wikimedia\Rdbms\Database::rollback Wikimedia\Rdbms\Database::doRollback.

Definition at line 1007 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testUnionConditionPermutations()

DatabaseSQLTest::testUnionConditionPermutations (   $params,
  $expect 
)

provideUnionConditionPermutations Wikimedia\Rdbms\Database::unionConditionPermutations

Definition at line 828 of file DatabaseSQLTest.php.

References $params, and database.

◆ testUnionQueries()

DatabaseSQLTest::testUnionQueries (   $sql,
  $sqlText 
)

provideUnionQueries Wikimedia\Rdbms\Database::unionQueries

Definition at line 791 of file DatabaseSQLTest.php.

References database.

◆ testUpdate()

DatabaseSQLTest::testUpdate (   $sql,
  $sqlText 
)

provideUpdate Wikimedia\Rdbms\Database::update Wikimedia\Rdbms\Database::makeUpdateOptions Wikimedia\Rdbms\Database::makeUpdateOptionsArray

Definition at line 207 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

◆ testUpsert()

DatabaseSQLTest::testUpsert (   $sql,
  $sqlText 
)

provideUpsert Wikimedia\Rdbms\Database::upsert

Definition at line 292 of file DatabaseSQLTest.php.

References assertLastSql(), and database.

Member Data Documentation

◆ $database

DatabaseTestHelper DatabaseSQLTest::$database
private

Definition at line 11 of file DatabaseSQLTest.php.


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