簡體   English   中英

如何確定我的phpunit測試是否在單獨的進程中運行?

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

我可以使用任何函數返回是否使用以下命令在單獨的進程中運行我的phpunit測試嗎?

@runTestsInSeparateProcesses

@preserveGlobalState disabled 

我試圖寫一個條件語句,例如

if ( _being_run_in_separate_process_ ){

}

else{

}

非常感謝!

您可以訪問屬性PHPUnit_Framework_TestCase::runTestInSeparateProcess 像這樣:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM