protected function tearDown()
{
if (class_exists('MonkeyPatch', false)) {
if (MonkeyPatchManager::isEnabled('FunctionPatcher')) {
try {
MonkeyPatch::verifyFunctionInvocations();
} catch (Exception $e) {
MonkeyPatch::resetFunctions();
throw $e;
}
MonkeyPatch::resetFunctions();
}
if (MonkeyPatchManager::isEnabled('ConstantPatcher')) {
MonkeyPatch::resetConstants();
}
if (MonkeyPatchManager::isEnabled('MethodPatcher')) {
try {
MonkeyPatch::verifyMethodInvocations();
} catch (Exception $e) {
MonkeyPatch::resetMethods();
throw $e;
}
MonkeyPatch::resetMethods();
}
}
}