From e2f2e697247877050116528d9d39490689ddc975 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 17 Apr 2013 11:20:50 -0700 Subject: [PATCH] Cleaned up test cleanup for FileBackend and avoid use of @. Change-Id: Ie9f0090f626384a90b0139b9f8c2d94bf0bb8f23 --- tests/phpunit/includes/filebackend/FileBackendTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index a73ccf0e91..3991c93116 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -892,6 +892,7 @@ class FileBackendTest extends MediaWikiTestCase { $this->backend = $this->singleBackend; $this->tearDownFiles(); $this->doTestConcatenate( $op, $srcs, $srcsContent, $alreadyExists, $okStatus ); + $this->filesToPrune[] = $op['dst']; # avoid file leaking $this->tearDownFiles(); $this->backend = $this->multiBackend; @@ -2196,7 +2197,9 @@ class FileBackendTest extends MediaWikiTestCase { function tearDownFiles() { foreach ( $this->filesToPrune as $file ) { - @unlink( $file ); + if ( is_file( $file ) ) { + unlink( $file ); + } } $containers = array( 'unittest-cont1', 'unittest-cont2' ); foreach ( $containers as $container ) { -- 2.20.1