/**
* JBZooPHPUnit_Coverage constructor.
* @SuppressWarnings(PHPMD.Superglobals)
*/
public function __construct()
{
if (Env::hasXdebug() && isset($_REQUEST['jbzoo-phpunit'])) {
$cmsType = $_REQUEST['jbzoo-phpunit-type'];
$testName = $_REQUEST['jbzoo-phpunit-test'];
$this->_covRoot = realpath(__DIR__ . '/../..');
$this->_covDir = realpath($this->_covRoot . '/src');
$this->_covHash = implode('_', [md5(serialize($_REQUEST)), mt_rand(0, 100000000)]);
$this->_covResult = realpath($this->_covRoot . '/build/coverage_cov') . '/' . $cmsType . '-' . $testName . '.cov';
$covFilter = new PHP_CodeCoverage_Filter();
$covFilter->addDirectoryToWhitelist($this->_covDir);
$this->_coverage = new PHP_CodeCoverage(null, $covFilter);
}
}