Merge "upload: Simplify UploadStashTest by using getNewTempFile()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Nov 2017 21:36:11 +0000 (21:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Nov 2017 21:36:11 +0000 (21:36 +0000)
tests/phpunit/includes/upload/UploadStashTest.php

index d754ba5..f46ad20 100644 (file)
@@ -19,7 +19,7 @@ class UploadStashTest extends MediaWikiTestCase {
        protected function setUp() {
                parent::setUp();
 
-               $this->tmpFile = wfTempDir() . '/' . uniqid();
+               $this->tmpFile = $this->getNewTempFile();
                file_put_contents( $this->tmpFile, "\x00" );
 
                self::$users = [
@@ -38,18 +38,6 @@ class UploadStashTest extends MediaWikiTestCase {
                ];
        }
 
-       protected function tearDown() {
-               if ( file_exists( $this->tmpFile . "." ) ) {
-                       unlink( $this->tmpFile . "." );
-               }
-
-               if ( file_exists( $this->tmpFile ) ) {
-                       unlink( $this->tmpFile );
-               }
-
-               parent::tearDown();
-       }
-
        /**
         * @todo give this test a real name explaining what is being tested here
         */