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 @@ -1,51 +1,54 @@ name = $name; execx( '%s upgrade --force --namespace %s', $this->getStorageBinPath(), $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( '%s destroy --force --namespace %s', $this->getStorageBinPath(), $this->name); } private function getStorageBinPath() { $root = dirname(phutil_get_library_root('phabricator')); return $root.'/bin/storage'; } }