如何确定我的phpunit测试是否在单独的进程中运行?

Is there any function I can use that would return whether my phpunit test is being run in a separate process using the following?

@runTestsInSeparateProcesses

@preserveGlobalState disabled 

I am trying to write a conditional statement such as

if ( _being_run_in_separate_process_ ){

}

else{

}

Thanks much!

You can access the property PHPUnit_Framework_TestCase::runTestInSeparateProcess. Like this:

if($this->runTestInSeparateProcess) {
    ...
}