From f3df65e630990d94986f2f58c5abca30b12dc5f1 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 4 Dec 2015 12:03:02 +0000 Subject: [PATCH] Remove redundant test teardown in UploadFromUrlTestSuite Looks like this was copied from the Parser upload test suite but never used. Change-Id: I41dd384d0cf996fdf459bc544d1430fc46d41025 --- .../phpunit/suites/UploadFromUrlTestSuite.php | 56 +------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index 80893dab41..5e704554f3 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -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" ); -- 2.20.1