mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 19:31:02 +01:00
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
This commit is contained in:
parent
0da0632242
commit
96f725009f
1 changed files with 4 additions and 1 deletions
|
@ -32,9 +32,12 @@ final class PhabricatorStorageFixtureScopeGuard {
|
||||||
$this->name);
|
$this->name);
|
||||||
|
|
||||||
PhabricatorLiskDAO::pushStorageNamespace($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();
|
PhabricatorLiskDAO::popStorageNamespace();
|
||||||
|
|
||||||
execx(
|
execx(
|
||||||
|
|
Loading…
Reference in a new issue