Making CodeCoverageManager get its settings from the reporter. This

makes code coverage much less reliant on GET parameters.
This commit is contained in:
Mark Story 2010-01-09 22:41:49 -05:00
parent 03da53bb92
commit d79bacd1ed

View file

@ -96,7 +96,7 @@ class CodeCoverageManager {
*/
function start($testCaseFile, &$reporter) {
$manager =& CodeCoverageManager::getInstance();
$manager->reporter = $reporter;
$manager->reporter =& $reporter;
$testCaseFile = str_replace(DS . DS, DS, $testCaseFile);
$thisFile = str_replace('.php', '.test.php', basename(__FILE__));
@ -104,16 +104,16 @@ class CodeCoverageManager {
trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR);
}
if (isset($_GET['app'])) {
if ($reporter->params['app']) {
$manager->appTest = true;
}
if (isset($_GET['group'])) {
if ($reporter->params['group']) {
$manager->groupTest = true;
}
if (isset($_GET['plugin'])) {
$manager->pluginTest = Inflector::underscore($_GET['plugin']);
if ($reporter->params['plugin']) {
$manager->pluginTest = Inflector::underscore($reporter->params['plugin']);
}
$manager->testCaseFile = $testCaseFile;
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);