X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fdb%2FDatabaseSQLTest.php;h=bdd567e7f6e37594d836704707c6b068fc4b9f2c;hb=5974804aee5bfc01ea6b49de8537df960035c0ce;hp=46ccfe00a5a702c399964d907a121f8f7e6f7127;hpb=7ab280ca486e3fef0fd1cbdbc18017d9455f04a1;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/db/DatabaseSQLTest.php b/tests/phpunit/includes/db/DatabaseSQLTest.php index 46ccfe00a5..bdd567e7f6 100644 --- a/tests/phpunit/includes/db/DatabaseSQLTest.php +++ b/tests/phpunit/includes/db/DatabaseSQLTest.php @@ -6,6 +6,9 @@ */ class DatabaseSQLTest extends MediaWikiTestCase { + /** + * @var DatabaseTestHelper + */ private $database; protected function setUp() { @@ -22,8 +25,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideSelect + * @covers DatabaseBase::select */ - function testSelect( $sql, $sqlText ) { + public function testSelect( $sql, $sqlText ) { $this->database->select( $sql['tables'], $sql['fields'], @@ -123,8 +127,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideUpdate + * @covers DatabaseBase::update */ - function testUpdate( $sql, $sqlText ) { + public function testUpdate( $sql, $sqlText ) { $this->database->update( $sql['table'], $sql['values'], @@ -174,8 +179,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideDelete + * @covers DatabaseBase::delete */ - function testDelete( $sql, $sqlText ) { + public function testDelete( $sql, $sqlText ) { $this->database->delete( $sql['table'], $sql['conds'], @@ -206,8 +212,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideUpsert + * @covers DatabaseBase::upsert */ - function testUpsert( $sql, $sqlText ) { + public function testUpsert( $sql, $sqlText ) { $this->database->upsert( $sql['table'], $sql['rows'], @@ -241,8 +248,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideDeleteJoin + * @covers DatabaseBase::deleteJoin */ - function testDeleteJoin( $sql, $sqlText ) { + public function testDeleteJoin( $sql, $sqlText ) { $this->database->deleteJoin( $sql['delTable'], $sql['joinTable'], @@ -287,8 +295,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideInsert + * @covers DatabaseBase::insert */ - function testInsert( $sql, $sqlText ) { + public function testInsert( $sql, $sqlText ) { $this->database->insert( $sql['table'], $sql['rows'], @@ -339,8 +348,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideInsertSelect + * @covers DatabaseBase::insertSelect */ - function testInsertSelect( $sql, $sqlText ) { + public function testInsertSelect( $sql, $sqlText ) { $this->database->insertSelect( $sql['destTable'], $sql['srcTable'], @@ -401,8 +411,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideReplace + * @covers DatabaseBase::replace */ - function testReplace( $sql, $sqlText ) { + public function testReplace( $sql, $sqlText ) { $this->database->replace( $sql['table'], $sql['uniqueIndexes'], @@ -515,8 +526,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideNativeReplace + * @covers DatabaseBase::nativeReplace */ - function testNativeReplace( $sql, $sqlText ) { + public function testNativeReplace( $sql, $sqlText ) { $this->database->nativeReplace( $sql['table'], $sql['rows'], @@ -541,8 +553,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideConditional + * @covers DatabaseBase::conditional */ - function testConditional( $sql, $sqlText ) { + public function testConditional( $sql, $sqlText ) { $this->assertEquals( trim( $this->database->conditional( $sql['conds'], $sql['true'], @@ -581,8 +594,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideBuildConcat + * @covers DatabaseBase::buildConcat */ - function testBuildConcat( $stringList, $sqlText ) { + public function testBuildConcat( $stringList, $sqlText ) { $this->assertEquals( trim( $this->database->buildConcat( $stringList ) ), $sqlText ); @@ -603,8 +617,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideBuildLike + * @covers DatabaseBase::buildLike */ - function testBuildLike( $array, $sqlText ) { + public function testBuildLike( $array, $sqlText ) { $this->assertEquals( trim( $this->database->buildLike( $array ) ), $sqlText ); @@ -633,8 +648,9 @@ class DatabaseSQLTest extends MediaWikiTestCase { /** * @dataProvider provideUnionQueries + * @covers DatabaseBase::unionQueries */ - function testUnionQueries( $sql, $sqlText ) { + public function testUnionQueries( $sql, $sqlText ) { $this->assertEquals( trim( $this->database->unionQueries( $sql['sqls'], $sql['all'] @@ -667,25 +683,37 @@ class DatabaseSQLTest extends MediaWikiTestCase { ); } - function testTransactionCommit() { + /** + * @covers DatabaseBase::commit + */ + public function testTransactionCommit() { $this->database->begin( __METHOD__ ); $this->database->commit( __METHOD__ ); $this->assertLastSql( 'BEGIN; COMMIT' ); } - function testTransactionRollback() { + /** + * @covers DatabaseBase::rollback + */ + public function testTransactionRollback() { $this->database->begin( __METHOD__ ); $this->database->rollback( __METHOD__ ); $this->assertLastSql( 'BEGIN; ROLLBACK' ); } - function testDropTable() { + /** + * @covers DatabaseBase::dropTable + */ + public function testDropTable() { $this->database->setExistingTables( array( 'table' ) ); $this->database->dropTable( 'table', __METHOD__ ); $this->assertLastSql( 'DROP TABLE table' ); } - function testDropNonExistingTable() { + /** + * @covers DatabaseBase::dropTable + */ + public function testDropNonExistingTable() { $this->assertFalse( $this->database->dropTable( 'non_existing', __METHOD__ ) );