protected function setUp() {
parent::setUp();
- $this->tmpFile = wfTempDir() . '/' . uniqid();
+ $this->tmpFile = $this->getNewTempFile();
file_put_contents( $this->tmpFile, "\x00" );
self::$users = [
];
}
- 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
*/
$stash->stashFile( $this->tmpFile );
$this->fail( 'Expected UploadStashFileException not thrown' );
} catch ( UploadStashFileException $e ) {
- $this->assertInstanceOf( 'ILocalizedException', $e );
+ $this->assertInstanceOf( ILocalizedException::class, $e );
} catch ( Exception $e ) {
$this->fail( 'Unexpected exception class ' . get_class( $e ) );
}