Skip to content

Instantly share code, notes, and snippets.

@mageekguy
Last active December 16, 2015 14:49
Show Gist options
  • Save mageekguy/5451571 to your computer and use it in GitHub Desktop.
Save mageekguy/5451571 to your computer and use it in GitHub Desktop.
To generate coverage treemap with atoum, just put this in your .atoum.php or a specific configuration file (and use -c argument to use it in this case)
<?php
/*
Sample atoum configuration file to have code coverage in html format and the treemap.
Do "php path/to/test/file -c path/to/this/file" or "php path/to/atoum/scripts/runner.php -c path/to/this/file -f path/to/test/file" to use it.
*/
use \mageekguy\atoum;
// HTML
/*
Please replace in next line /path/to/destination/directory by your destination directory path for html files.
*/
$coverageHtmlField = new atoum\report\fields\runner\coverage\html('Your project name', '/path/to/destination/directory');
/*
Please replace in next line http://url/of/web/site by the root url of your code coverage web site.
*/
$coverageHtmlField->setRootUrl('http://url/of/web/site');
// Treemap (not mandatory)
/*
Please replace in next line /path/to/destination/directory by your destination directory path for html files.
*/
$coverageTreemapField = new atoum\report\fields\runner\coverage\treemap('Your project name', '/path/to/destination/directory');
/*
Please replace in next line http://url/of/treemap by the root url of your treemap web site.
*/
$coverageTreemapField
->setTreemapUrl('http://url/of/treemap')
->setHtmlReportBaseUrl($coverageHtmlField->getRootUrl())
;
$script
->addDefaultReport()
->addField($coverageHtmlField)
->addField($coverageTreemapField)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment