Remove redundant test teardown in UploadFromUrlTestSuite
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 4 Dec 2015 12:03:02 +0000 (12:03 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 12 Jan 2016 01:59:05 +0000 (17:59 -0800)
Looks like this was copied from the Parser upload test suite
but never used.

Change-Id: I41dd384d0cf996fdf459bc544d1430fc46d41025

tests/phpunit/suites/UploadFromUrlTestSuite.php

index 80893da..5e70455 100644 (file)
@@ -86,55 +86,9 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                RepoGroup::destroySingleton();
                FileBackendGroup::destroySingleton();
 
-               $this->teardownUploadDir( $this->uploadDir );
-
                parent::tearDown();
        }
 
-       private $uploadDir;
-       private $keepUploads;
-
-       /**
-        * Remove the dummy uploads directory
-        * @param string $dir
-        */
-       private function teardownUploadDir( $dir ) {
-               if ( $this->keepUploads ) {
-                       return;
-               }
-
-               // delete the files first, then the dirs.
-               self::deleteFiles(
-                       array(
-                               "$dir/3/3a/Foobar.jpg",
-                               "$dir/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg",
-                               "$dir/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg",
-                               "$dir/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg",
-                               "$dir/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg",
-
-                               "$dir/0/09/Bad.jpg",
-                       )
-               );
-
-               self::deleteDirs(
-                       array(
-                               "$dir/3/3a",
-                               "$dir/3",
-                               "$dir/thumb/6/65",
-                               "$dir/thumb/6",
-                               "$dir/thumb/3/3a/Foobar.jpg",
-                               "$dir/thumb/3/3a",
-                               "$dir/thumb/3",
-
-                               "$dir/0/09/",
-                               "$dir/0/",
-
-                               "$dir/thumb",
-                               "$dir",
-                       )
-               );
-       }
-
        /**
         * Delete the specified files, if they exist.
         *
@@ -170,15 +124,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        private function setupUploadDir() {
                global $IP;
 
-               if ( $this->keepUploads ) {
-                       $dir = wfTempDir() . '/mwParser-images';
-
-                       if ( is_dir( $dir ) ) {
-                               return $dir;
-                       }
-               } else {
-                       $dir = $this->getNewTempDirectory();
-               }
+               $dir = $this->getNewTempDirectory();
 
                wfDebug( "Creating upload directory $dir\n" );