Merge pull request #1129 from tomb1n0/bugfix/alwaysCallTeardownRegardlessOfExceptions

[Bug] Always call parent teardown even if an exception is thrown
This commit is contained in:
Nuno Maduro
2024-08-22 20:50:59 +01:00
committed by GitHub

View File

@ -234,12 +234,14 @@ trait Testable
$afterEach = ChainableClosure::bound($this->__afterEach, $afterEach); $afterEach = ChainableClosure::bound($this->__afterEach, $afterEach);
} }
try {
$this->__callClosure($afterEach, func_get_args()); $this->__callClosure($afterEach, func_get_args());
} finally {
parent::tearDown(); parent::tearDown();
TestSuite::getInstance()->test = null; TestSuite::getInstance()->test = null;
} }
}
/** /**
* Executes the Test Case current test. * Executes the Test Case current test.