简体   繁体   中英

How can I determine if my phpunit test is running in a separate process?

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) {
    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM