diff --git a/src/infrastructure/testing/PhabricatorTestCase.php b/src/infrastructure/testing/PhabricatorTestCase.php index dbdd1ef126..12f18567bc 100644 --- a/src/infrastructure/testing/PhabricatorTestCase.php +++ b/src/infrastructure/testing/PhabricatorTestCase.php @@ -56,22 +56,35 @@ abstract class PhabricatorTestCase extends ArcanistPhutilTestCase { return $config; } - protected function willRunTests() { + public function willRunTestCases(array $test_cases) { $root = dirname(phutil_get_library_root('phabricator')); require_once $root.'/scripts/__init_script__.php'; $config = $this->getComputedConfiguration(); - if ($config[self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK]) { - LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess(); - } - if ($config[self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES]) { ++self::$storageFixtureReferences; if (!self::$storageFixture) { self::$storageFixture = $this->newStorageFixture(); } } + } + + public function didRunTestCases(array $test_cases) { + if (self::$storageFixture) { + self::$storageFixtureReferences--; + if (!self::$storageFixtureReferences) { + self::$storageFixture = null; + } + } + } + + protected function willRunTests() { + $config = $this->getComputedConfiguration(); + + if ($config[self::PHABRICATOR_TESTCONFIG_ISOLATE_LISK]) { + LiskDAO::beginIsolateAllLiskEffectsToCurrentProcess(); + } $this->env = PhabricatorEnv::beginScopedEnv(); } @@ -83,13 +96,6 @@ abstract class PhabricatorTestCase extends ArcanistPhutilTestCase { LiskDAO::endIsolateAllLiskEffectsToCurrentProcess(); } - if (self::$storageFixture) { - self::$storageFixtureReferences--; - if (!self::$storageFixtureReferences) { - self::$storageFixture = null; - } - } - try { if (phutil_is_hiphop_runtime()) { $this->env->__destruct();