MDL-60978 testing: Support ability to run phpunit in isolated process

This commit is contained in:
Andrew Nicols
2019-06-21 14:36:13 +08:00
parent e39f3b7db2
commit 22ad84cb00
6 changed files with 64 additions and 35 deletions
+12
View File
@@ -984,4 +984,16 @@ class phpunit_util extends testing_util {
return null;
}
/**
* Whether the current process is an isolated test process.
*
* @return bool
*/
public static function is_in_isolated_process(): bool {
// Note: There is no function to call, or much to go by in order to tell whether we are in an isolated process
// during Bootstrap, when this function is called.
// We can do so by testing the existence of the wrapper function, but there is nothing set until that point.
return function_exists('__phpunit_run_isolated_test');
}
}