Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/109470
Change subject: Remove unused stuff from tests
......................................................................
Remove unused stuff from tests
Change-Id: Iddabfbc80378b02fa4a2c58f80d50241be8105d3
---
M tests/phpunit/includes/RevisionStorageTest.php
M tests/phpunit/includes/WikiPageTest.php
M tests/phpunit/includes/XmlTest.php
M tests/phpunit/includes/api/ApiEditPageTest.php
M tests/phpunit/includes/libs/RunningStatTest.php
M tests/phpunit/includes/objectcache/BagOStuffTest.php
M tests/phpunit/includes/upload/UploadFromUrlTest.php
M tests/phpunit/includes/utils/UIDGeneratorTest.php
8 files changed, 1 insertion(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/70/109470/2
diff --git a/tests/phpunit/includes/RevisionStorageTest.php
b/tests/phpunit/includes/RevisionStorageTest.php
index f69fad4..1428a27 100644
--- a/tests/phpunit/includes/RevisionStorageTest.php
+++ b/tests/phpunit/includes/RevisionStorageTest.php
@@ -206,7 +206,6 @@
*/
public function testFetchRevision() {
$page = $this->createPage(
'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT );
- $id1 = $page->getRevision()->getId();
$page->doEditContent( new WikitextContent( 'two' ), 'second
rev' );
$id2 = $page->getRevision()->getId();
@@ -219,7 +218,6 @@
$rows[$row->rev_id] = $row;
}
- $row = $res->fetchObject();
$this->assertEquals( 1, count( $rows ), 'expected exactly one
revision' );
$this->assertArrayHasKey( $id2, $rows, 'missing revision with
id ' . $id2 );
}
diff --git a/tests/phpunit/includes/WikiPageTest.php
b/tests/phpunit/includes/WikiPageTest.php
index 796adf3..f6cbfa9 100644
--- a/tests/phpunit/includes/WikiPageTest.php
+++ b/tests/phpunit/includes/WikiPageTest.php
@@ -593,8 +593,6 @@
}
$page = $this->createPage( $title, $text, $model );
- $hasLinks = wfGetDB( DB_SLAVE )->selectField( 'pagelinks', 1,
- array( 'pl_from' => $page->getId() ), __METHOD__ );
$editInfo = $page->prepareContentForEdit( $page->getContent() );
diff --git a/tests/phpunit/includes/XmlTest.php
b/tests/phpunit/includes/XmlTest.php
index 8205029..86b4c35 100644
--- a/tests/phpunit/includes/XmlTest.php
+++ b/tests/phpunit/includes/XmlTest.php
@@ -144,10 +144,7 @@
$prevYear = $curYear - 1;
$curMonth = intval( gmdate( 'n' ) );
- $prevMonth = $curMonth - 1;
- if ( $prevMonth == 0 ) {
- $prevMonth = 12;
- }
+
$nextMonth = $curMonth + 1;
if ( $nextMonth == 13 ) {
$nextMonth = 1;
diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php
b/tests/phpunit/includes/api/ApiEditPageTest.php
index 0a6607e..80c2fde 100644
--- a/tests/phpunit/includes/api/ApiEditPageTest.php
+++ b/tests/phpunit/includes/api/ApiEditPageTest.php
@@ -391,7 +391,6 @@
$rpage->doEditContent( new WikitextContent( "#REDIRECT
[[$name]]" ),
"testing 1", EDIT_NEW, false,
self::$users['sysop']->user );
$this->forceRevisionDate( $rpage, '20120101000000' );
- $baseTime = $rpage->getRevision()->getTimestamp();
// new edit to content
$page->doEditContent( new WikitextContent( "Foo bar" ),
diff --git a/tests/phpunit/includes/libs/RunningStatTest.php
b/tests/phpunit/includes/libs/RunningStatTest.php
index e24c088..dc5db82 100644
--- a/tests/phpunit/includes/libs/RunningStatTest.php
+++ b/tests/phpunit/includes/libs/RunningStatTest.php
@@ -32,8 +32,6 @@
return pow( $mean - $x, 2 );
}, $this->points ) ) / ( count( $rstat ) - 1 );
$stddev = sqrt( $variance );
- $min = min( $this->points );
- $max = max( $this->points );
$this->assertEquals( count( $rstat ), count( $this->points ) );
$this->assertEquals( $rstat->min, min( $this->points ) );
diff --git a/tests/phpunit/includes/objectcache/BagOStuffTest.php
b/tests/phpunit/includes/objectcache/BagOStuffTest.php
index aa78394..1670823 100644
--- a/tests/phpunit/includes/objectcache/BagOStuffTest.php
+++ b/tests/phpunit/includes/objectcache/BagOStuffTest.php
@@ -74,8 +74,6 @@
$fork &= !$this->cache instanceof MultiWriteBagOStuff;
if ( $fork ) {
// callback should take awhile now so that we can test
concurrent merge attempts
- $usleep = 5000;
-
$pid = pcntl_fork();
if ( $pid == -1 ) {
// can't fork, ignore this test...
diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php
b/tests/phpunit/includes/upload/UploadFromUrlTest.php
index 397c100..695f869 100644
--- a/tests/phpunit/includes/upload/UploadFromUrlTest.php
+++ b/tests/phpunit/includes/upload/UploadFromUrlTest.php
@@ -224,9 +224,6 @@
$this->deleteFile( 'UploadFromUrlTest.png' );
- $talkRev = Revision::newFromTitle( $talk );
- $talkSize = $talkRev->getSize();
-
$exception = false;
try {
$this->doApiRequest( array(
diff --git a/tests/phpunit/includes/utils/UIDGeneratorTest.php
b/tests/phpunit/includes/utils/UIDGeneratorTest.php
index 1a1bbaf..1eab5a3 100644
--- a/tests/phpunit/includes/utils/UIDGeneratorTest.php
+++ b/tests/phpunit/includes/utils/UIDGeneratorTest.php
@@ -21,9 +21,6 @@
}
$lastId = array_shift( $ids );
- if ( $hostbits ) {
- $lastHost = substr( wfBaseConvert( $lastId, 10, 2,
$bits ), -$hostbits );
- }
$this->assertArrayEquals( array_unique( $ids ), $ids, "All
generated IDs are unique." );
--
To view, visit https://gerrit.wikimedia.org/r/109470
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddabfbc80378b02fa4a2c58f80d50241be8105d3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits