[] ]; /** * Runs the tests and collects their result in a TestResult. * * @param TestResult|NULL $result * * @return ?TestResult * @throws ReflectionException */ public function run(TestResult $result = NULL): TestResult { // Get the code coverage filter from the suite's result object $coverage = FALSE; if ($result !== NULL) { $coverage = $result->getCodeCoverage(); } if ($coverage) { $coverage_filter = $coverage->filter(); // Apply the white and blacklisting foreach ($this->_filter_calls as $method => $args) { foreach ($args as $arg) { $coverage_filter->$method($arg); } } } return parent::run($result); } /** * Queues a file to be added to the code coverage whitelist when the suite runs * * @param string $file */ public function addFileToWhitelist(string $file) : void { $this->_filter_calls['addFileToWhitelist'][] = $file; } }