From 96f725009fd508d0fc574e2b223993c533c73b40 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 24 May 2012 15:35:49 -0700 Subject: [PATCH] Destroy fixture explicitly Summary: Unittest databases are not always destroyed in our setup. It could be caused by `__destruct()` not called in case of a fatal error. Test Plan: arc unit src/applications/calendar/storage/holiday Reviewers: edward, epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2568 --- .../fixture/storage/PhabricatorStorageFixtureScopeGuard.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/testing/fixture/storage/PhabricatorStorageFixtureScopeGuard.php b/src/infrastructure/testing/fixture/storage/PhabricatorStorageFixtureScopeGuard.php index f1cda5344b..358b04f482 100644 --- a/src/infrastructure/testing/fixture/storage/PhabricatorStorageFixtureScopeGuard.php +++ b/src/infrastructure/testing/fixture/storage/PhabricatorStorageFixtureScopeGuard.php @@ -32,9 +32,12 @@ final class PhabricatorStorageFixtureScopeGuard { $this->name); PhabricatorLiskDAO::pushStorageNamespace($name); + + // Destructor is not called with fatal error. + register_shutdown_function(array($this, 'destroy')); } - public function __destruct() { + public function destroy() { PhabricatorLiskDAO::popStorageNamespace(); execx(