tests: Remove some unused stuff in phpunit tests
authorMax Semenik <maxsem.wiki@gmail.com>
Sat, 17 Mar 2018 07:49:07 +0000 (00:49 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 26 Mar 2018 22:45:29 +0000 (22:45 +0000)
Change-Id: Ica20e4f4ac0887b7cac12700ffcd15f587b3ba01

tests/phpunit/includes/Storage/RevisionStoreRecordTest.php
tests/phpunit/includes/libs/ArrayUtilsTest.php
tests/phpunit/maintenance/backup_PageTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php

index 3976995..09f5675 100644 (file)
@@ -679,10 +679,6 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
                );
        }
 
-       private function getSlotRecord( $role, $contentString ) {
-               return SlotRecord::newUnsaved( $role, new TextContent( $contentString ) );
-       }
-
        public function provideHasSameContent() {
                /**
                 * @param SlotRecord[] $slots
index 4fbbc99..d5ac77b 100644 (file)
@@ -8,8 +8,6 @@ class ArrayUtilsTest extends PHPUnit\Framework\TestCase {
 
        use MediaWikiCoversValidator;
 
-       private $search;
-
        /**
         * @covers ArrayUtils::findLowerBound
         * @dataProvider provideFindLowerBound
index 34ae538..51a1ed6 100644 (file)
@@ -19,8 +19,8 @@ class BackupDumperPageTest extends DumpTestCase {
 
        // We'll add several pages, revision and texts. The following variables hold the
        // corresponding ids.
-       private $pageId1, $pageId2, $pageId3, $pageId4, $pageId5;
-       private $pageTitle1, $pageTitle2, $pageTitle3, $pageTitle4, $pageTitle5;
+       private $pageId1, $pageId2, $pageId3, $pageId4;
+       private $pageTitle1, $pageTitle2, $pageTitle3, $pageTitle4;
        private $revId1_1, $textId1_1;
        private $revId2_1, $textId2_1, $revId2_2, $textId2_2;
        private $revId2_3, $textId2_3, $revId2_4, $textId2_4;
index 6fb428b..556c754 100644 (file)
@@ -18,8 +18,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        protected function setUp() {
                global $wgParser, $wgParserConf, $IP, $messageMemc, $wgMemc, $wgUser,
                        $wgLang, $wgOut, $wgRequest, $wgStyleDirectory,
-                       $wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection,
-                       $parserMemc;
+                       $wgParserCacheType, $wgNamespaceAliases, $wgNamespaceProtection;
 
                $tmpDir = $this->getNewTempDirectory();
                $tmpGlobals = [];
@@ -89,54 +88,6 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                parent::tearDown();
        }
 
-       /**
-        * Delete the specified files, if they exist.
-        *
-        * @param array $files Full paths to files to delete.
-        */
-       private static function deleteFiles( $files ) {
-               foreach ( $files as $file ) {
-                       if ( file_exists( $file ) ) {
-                               unlink( $file );
-                       }
-               }
-       }
-
-       /**
-        * Delete the specified directories, if they exist. Must be empty.
-        *
-        * @param array $dirs Full paths to directories to delete.
-        */
-       private static function deleteDirs( $dirs ) {
-               foreach ( $dirs as $dir ) {
-                       if ( is_dir( $dir ) ) {
-                               rmdir( $dir );
-                       }
-               }
-       }
-
-       /**
-        * Create a dummy uploads directory which will contain a couple
-        * of files in order to pass existence tests.
-        *
-        * @return string The directory
-        */
-       private function setupUploadDir() {
-               global $IP;
-
-               $dir = $this->getNewTempDirectory();
-
-               wfDebug( "Creating upload directory $dir\n" );
-
-               wfMkdirParents( $dir . '/3/3a', null, __METHOD__ );
-               copy( "$IP/tests/phpunit/data/upload/headbg.jpg", "$dir/3/3a/Foobar.jpg" );
-
-               wfMkdirParents( $dir . '/0/09', null, __METHOD__ );
-               copy( "$IP/tests/phpunit/data/upload/headbg.jpg", "$dir/0/09/Bad.jpg" );
-
-               return $dir;
-       }
-
        public static function suite() {
                // Hack to invoke the autoloader required to get phpunit to recognize
                // the UploadFromUrlTest class