From 6435a6e7371195c2f6ef8d65860ac0cbf2c157e7 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 25 May 2012 03:40:56 -0700 Subject: [PATCH] [FileBackend] Purge Swift process cache before container delete for sanity. * Also tweaked some documentation. Change-Id: I89369d6211de216193ae1d895356137cacded5d7 --- includes/filerepo/backend/SwiftFileBackend.php | 6 +++--- tests/phpunit/includes/filerepo/FileBackendTest.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/filerepo/backend/SwiftFileBackend.php b/includes/filerepo/backend/SwiftFileBackend.php index 36d4334e7f..d5e0c6794a 100644 --- a/includes/filerepo/backend/SwiftFileBackend.php +++ b/includes/filerepo/backend/SwiftFileBackend.php @@ -1114,7 +1114,7 @@ class SwiftFileBackend extends FileBackendStore { * * @param $container string Container name * @return CF_Container - * @throws InvalidResponseException + * @throws CloudFilesException */ protected function createContainer( $container ) { $conn = $this->getConnection(); // Swift proxy connection @@ -1128,12 +1128,12 @@ class SwiftFileBackend extends FileBackendStore { * * @param $container string Container name * @return void - * @throws InvalidResponseException + * @throws CloudFilesException */ protected function deleteContainer( $container ) { $conn = $this->getConnection(); // Swift proxy connection - $conn->delete_container( $container ); unset( $this->connContainers[$container] ); // purge cache + $conn->delete_container( $container ); } /** diff --git a/tests/phpunit/includes/filerepo/FileBackendTest.php b/tests/phpunit/includes/filerepo/FileBackendTest.php index 2b94778b37..710ad83e71 100644 --- a/tests/phpunit/includes/filerepo/FileBackendTest.php +++ b/tests/phpunit/includes/filerepo/FileBackendTest.php @@ -1392,8 +1392,11 @@ class FileBackendTest extends MediaWikiTestCase { private function doTestGetFileList() { $backendName = $this->backendClass(); - $base = $this->baseStorePath(); + + // Should have no errors + $iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont-notexists" ) ); + $files = array( "$base/unittest-cont1/test1.txt", "$base/unittest-cont1/test2.txt", -- 2.20.1