jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/366772 )
Change subject: rdbms: Move DatabaseMysqlBaseTest to libs tests
......................................................................
rdbms: Move DatabaseMysqlBaseTest to libs tests
* Remove MediaWikiTestCase dependency.
* Add missing @covers tags.
* Add missing visibility/static declarations.
Change-Id: I2d81a9265016174e7b4ff810f140f7d031ce9f14
---
R tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
1 file changed, 16 insertions(+), 11 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
similarity index 92%
rename from tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
rename to tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
index 3dc810c..0d817fa 100644
--- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
+++ b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
@@ -1,6 +1,6 @@
<?php
/**
- * Holds tests for DatabaseMysqlBase MediaWiki class.
+ * Holds tests for DatabaseMysqlBase class.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -104,7 +104,7 @@
}
}
-class DatabaseMysqlBaseTest extends MediaWikiTestCase {
+class DatabaseMysqlBaseTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider provideDiapers
* @covers DatabaseMysqlBase::addIdentifierQuotes
@@ -120,7 +120,7 @@
*
* Named per T22281 convention.
*/
- function provideDiapers() {
+ public static function provideDiapers() {
return [
// Format: expected, input
[ '``', '' ],
@@ -171,7 +171,7 @@
return json_decode( '"' . $str . '"' );
}
- function getMockForViews() {
+ private function getMockForViews() {
$db = $this->getMockBuilder( 'DatabaseMysqli' )
->disableOriginalConstructor()
->setMethods( [ 'fetchRow', 'query' ] )
@@ -187,10 +187,11 @@
return $db;
}
+
/**
* @covers DatabaseMysqlBase::listViews
*/
- function testListviews() {
+ public function testListviews() {
$db = $this->getMockForViews();
$this->assertEquals( [ 'view1', 'view2', 'myview' ],
@@ -209,8 +210,9 @@
/**
* @dataProvider provideComparePositions
+ * @covers MySQLMasterPos
*/
- function testHasReached( MySQLMasterPos $lowerPos, MySQLMasterPos
$higherPos, $match ) {
+ public function testHasReached( MySQLMasterPos $lowerPos,
MySQLMasterPos $higherPos, $match ) {
if ( $match ) {
$this->assertTrue( $lowerPos->channelsMatch( $higherPos
) );
@@ -226,7 +228,7 @@
}
}
- function provideComparePositions() {
+ public static function provideComparePositions() {
return [
// Binlog style
[
@@ -281,13 +283,14 @@
/**
* @dataProvider provideChannelPositions
+ * @covers MySQLMasterPos
*/
- function testChannelsMatch( MySQLMasterPos $pos1, MySQLMasterPos $pos2,
$matches ) {
+ public function testChannelsMatch( MySQLMasterPos $pos1, MySQLMasterPos
$pos2, $matches ) {
$this->assertEquals( $matches, $pos1->channelsMatch( $pos2 ) );
$this->assertEquals( $matches, $pos2->channelsMatch( $pos1 ) );
}
- function provideChannelPositions() {
+ public static function provideChannelPositions() {
return [
[
new MySQLMasterPos( 'db1034-bin.000876', '44' ),
@@ -314,8 +317,10 @@
/**
* @dataProvider provideLagAmounts
+ * @covers DatabaseMysqlBase::getLag
+ * @covers DatabaseMysqlBase::getLagFromPtHeartbeat
*/
- function testPtHeartbeat( $lag ) {
+ public function testPtHeartbeat( $lag ) {
$db = $this->getMockBuilder( 'DatabaseMysqli' )
->disableOriginalConstructor()
->setMethods( [
@@ -351,7 +356,7 @@
$this->assertLessThan( $lag + .010, $lagEst, "Correct heatbeat
lag" );
}
- function provideLagAmounts() {
+ public static function provideLagAmounts() {
return [
[ 0 ],
[ 0.3 ],
--
To view, visit https://gerrit.wikimedia.org/r/366772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d81a9265016174e7b4ff810f140f7d031ce9f14
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits