Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting work on HtmlCoverageReport and adding a test case.
- Loading branch information
Showing
2 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'coverage' . DS . 'html_coverage_report.php'; | ||
|
||
class HtmlCoverageReportTest extends CakeTestCase { | ||
/** | ||
* setup | ||
* | ||
* @return void | ||
*/ | ||
public function setUp() { | ||
$reporter = new CakeBaseReporter(); | ||
$reporter->params = array('app' => false, 'plugin' => false, 'group' => false); | ||
$coverage = array(); | ||
$this->Coverage = new HtmlCoverageReport($coverage, $reporter); | ||
} | ||
|
||
/** | ||
* test getting the path filters. | ||
* | ||
* @return void | ||
*/ | ||
function testGetPathFilter() { | ||
$this->Coverage->appTest = false; | ||
$result = $this->Coverage->getPathFilter(); | ||
$this->assertEquals(TEST_CAKE_CORE_INCLUDE_PATH, $result); | ||
|
||
$this->Coverage->appTest = true; | ||
$result = $this->Coverage->getPathFilter(); | ||
$this->assertEquals(ROOT . DS . APP_DIR . DS, $result); | ||
|
||
$this->Coverage->appTest = false; | ||
$this->Coverage->pluginTest = 'test_plugin'; | ||
$result = $this->Coverage->getPathFilter(); | ||
$this->assertEquals(ROOT . DS . APP_DIR . DS . 'plugins' . DS .'test_plugin' . DS, $result); | ||
} | ||
|
||
/** | ||
* teardown | ||
* | ||
* @return void | ||
*/ | ||
function tearDown() { | ||
unset($this->Coverage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters