mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
b7510d4883
commit
58eb7b80ab
3 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||||
|
|
|
@ -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' : '';
|
||||||
|
|
|
@ -205,6 +205,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
||||||
echo "<p><a href='" . $this->baseUrl() . $show . "'>Run more tests</a> | <a href='" . $this->baseUrl() . $query . "&show_passes=1'>Show Passes</a> | \n";
|
echo "<p><a href='" . $this->baseUrl() . $show . "'>Run more tests</a> | <a href='" . $this->baseUrl() . $query . "&show_passes=1'>Show Passes</a> | \n";
|
||||||
echo "<a href='" . $this->baseUrl() . $query . "&debug=1'>Enable Debug Output</a> | \n";
|
echo "<a href='" . $this->baseUrl() . $query . "&debug=1'>Enable Debug Output</a> | \n";
|
||||||
echo "<a href='" . $this->baseUrl() . $query . "&code_coverage=true'>Analyze Code Coverage</a></p>\n";
|
echo "<a href='" . $this->baseUrl() . $query . "&code_coverage=true'>Analyze Code Coverage</a></p>\n";
|
||||||
|
echo "<a href='" . $this->baseUrl() . $query . "&code_coverage=true&show_passes=1&debug=1'>All options enabled</a></p>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue