public function run() { $result = ""; foreach($this->files as $oneDirectory => $testCollection) { $suite = new PHPUnit_Framework_TestSuite(); $suite->setBackupGlobals(false); $suite->setName($oneDirectory); $this->includeCases($testCollection, $suite); $this->suite->addTestSuite($suite); } if($this->includeCoverage) { $this->importCodeCoverage(); $this->setCodeCoverageIgnores(); } $this->suite->run($this->result); $xml = new SimpleXMLElement($this->listener->getXML()); $casesReport = new HTMLReport(); $result .= $casesReport->report($xml); if($this->includeCoverage) { $CodeCoverage = $this->result->getCodeCoverage(); $coverageReport = new CodeCoverageReport(); $result .= $coverageReport->report($CodeCoverage); //$writer = new PHP_CodeCoverage_Report_HTML; //$writer->process($CodeCoverage, dirname(__FILE__).'/tmp/'); } $this->report = $result; }
public function output() { header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=document_name.doc"); parent::output(); }