From: Aaron Schulz Date: Wed, 17 Apr 2013 18:20:50 +0000 (-0700) Subject: Cleaned up test cleanup for FileBackend and avoid use of @. X-Git-Tag: 1.31.0-rc.0~19962 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=e2f2e697247877050116528d9d39490689ddc975;p=lhc%2Fweb%2Fwiklou.git Cleaned up test cleanup for FileBackend and avoid use of @. Change-Id: Ie9f0090f626384a90b0139b9f8c2d94bf0bb8f23 --- 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 ) {