Added All options enabled when running test from webfrontend

Fix failing test

Fix CS problem with new code

Fix test for code coverage generator

Fix tests

Fix CS Errors

Removed spaces in tabulation
This commit is contained in:
Esteban 2014-12-23 17:29:08 -03:00 committed by tranfuga25s
parent b7510d4883
commit 58eb7b80ab
3 changed files with 4 additions and 3 deletions

View file

@ -119,7 +119,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
); );
$result = $this->Coverage->generateDiff('myfile.php', $file, $coverage); $result = $this->Coverage->generateDiff('myfile.php', $file, $coverage);
$this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result); $this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
$this->assertRegExp('/<div class="code-coverage-results" id\="coverage\-myfile\.php"/', $result); $this->assertRegExp('/<div class="code-coverage-results" id\="coverage\-myfile\.php-' . md5('myfile.php') . '"/', $result);
$this->assertRegExp('/<pre>/', $result); $this->assertRegExp('/<pre>/', $result);
foreach ($file as $i => $line) { foreach ($file as $i => $line) {
$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i); $this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);
@ -167,7 +167,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
$result = $this->Coverage->generateDiff('myfile.php', $file, $coverage); $result = $this->Coverage->generateDiff('myfile.php', $file, $coverage);
$this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result); $this->assertRegExp('/myfile\.php Code coverage\: \d+\.?\d*\%/', $result);
$this->assertRegExp('/<div class="code-coverage-results" id\="coverage\-myfile\.php"/', $result); $this->assertRegExp('/<div class="code-coverage-results" id\="coverage\-myfile\.php-' . md5('myfile.php') . '"/', $result);
$this->assertRegExp('/<pre>/', $result); $this->assertRegExp('/<pre>/', $result);
foreach ($file as $i => $line) { foreach ($file as $i => $line) {
$this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i); $this->assertTrue(strpos($line, $result) !== 0, 'Content is missing ' . $i);

View file

@ -200,8 +200,8 @@ HTML;
* @return string * @return string
*/ */
public function coverageHeader($filename, $percent) { public function coverageHeader($filename, $percent) {
$hash = md5($filename);
$filename = basename($filename); $filename = basename($filename);
$hash = md5( $filename.$percent);
list($file) = explode('.', $filename); list($file) = explode('.', $filename);
$display = in_array($file, $this->_testNames) ? 'block' : 'none'; $display = in_array($file, $this->_testNames) ? 'block' : 'none';
$primary = $display === 'block' ? 'primary' : ''; $primary = $display === 'block' ? 'primary' : '';

View file

@ -205,6 +205,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "<p><a href='" . $this->baseUrl() . $show . "'>Run more tests</a> | <a href='" . $this->baseUrl() . $query . "&amp;show_passes=1'>Show Passes</a> | \n"; echo "<p><a href='" . $this->baseUrl() . $show . "'>Run more tests</a> | <a href='" . $this->baseUrl() . $query . "&amp;show_passes=1'>Show Passes</a> | \n";
echo "<a href='" . $this->baseUrl() . $query . "&amp;debug=1'>Enable Debug Output</a> | \n"; echo "<a href='" . $this->baseUrl() . $query . "&amp;debug=1'>Enable Debug Output</a> | \n";
echo "<a href='" . $this->baseUrl() . $query . "&amp;code_coverage=true'>Analyze Code Coverage</a></p>\n"; echo "<a href='" . $this->baseUrl() . $query . "&amp;code_coverage=true'>Analyze Code Coverage</a></p>\n";
echo "<a href='" . $this->baseUrl() . $query . "&amp;code_coverage=true&amp;show_passes=1&amp;debug=1'>All options enabled</a></p>\n";
} }
/** /**