From 2fdb1e997f030155bd6648f9d72a77ccecda0324 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 15 Jan 2014 19:05:25 +0100 Subject: Removed ?> from tests --- .../simpletest/HtmlReporterWithCoverage.php | 65 +++++++++++----------- 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'tests/test_tools/simpletest/HtmlReporterWithCoverage.php') diff --git a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php index abd10076..f3ae2391 100644 --- a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php +++ b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php @@ -1,11 +1,11 @@ base_dir = $base_dir; } - function paintHeader($test_name, $charset="UTF-8") + function paintHeader($test_name, $charset="UTF-8") { $this->sendNoCacheHeaders(); header('Content-Type: text/html; Charset='.$charset); @@ -31,30 +31,30 @@ class HtmlReporterWithCoverage extends HtmlReporter print "\n\n"; print "

$test_name

\n"; flush(); - - if (extension_loaded('xdebug')) + + if (extension_loaded('xdebug')) xdebug_start_code_coverage(XDEBUG_CC_UNUSED); - } + } /** * */ - function _getCss() + function _getCss() { $contents = parent::_getCss()."\n "; $contents .= ' - .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} - .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } - .coverage {margin: 0.4em; } + .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} + .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } + .coverage {margin: 0.4em; } .coverage a { padding-left: 0.5em; } - .coverage:after { - content: "."; - display: block; - height: 0; - clear: both; + .coverage:after { + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } .coverage {display: inline-block;} @@ -66,9 +66,9 @@ class HtmlReporterWithCoverage extends HtmlReporter Return $contents; } - function paintFooter($test_name) + function paintFooter($test_name) { - if (extension_loaded('xdebug')) + if (extension_loaded('xdebug')) { $this->coverage = xdebug_get_code_coverage(); xdebug_stop_code_coverage(); @@ -93,10 +93,10 @@ class HtmlReporterWithCoverage extends HtmlReporter $dir = dirname(__FILE__); if(count($this->coverage) > 0) print '

Code Coverage

'; - - - ksort($this->coverage); - + + + ksort($this->coverage); + $details = array(); foreach($this->coverage as $file => $coverage) { @@ -110,7 +110,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $width = $percentage * 3; $filename = str_replace($this->base_dir, '',$file); $link = $this->constructURL($filename, $coverage); - + $detail['total'] = $total; $detail['executed'] = $executed; $detail['width'] = $width; @@ -150,7 +150,7 @@ class HtmlReporterWithCoverage extends HtmlReporter } -class HTMLCoverageReport extends HtmlReporter +class HTMLCoverageReport extends HtmlReporter { protected $file; protected $lines; @@ -184,7 +184,7 @@ class HTMLCoverageReport extends HtmlReporter $this->paintFooter(); } - function paintHeader($file, $charset="UTF-8") + function paintHeader($file, $charset="UTF-8") { $total = $this->codelines($this->file); $executed = count($this->lines); @@ -218,21 +218,21 @@ class HTMLCoverageReport extends HtmlReporter $lines = ''; - foreach ($tokens as $token) + foreach ($tokens as $token) { - if (is_string($token)) + if (is_string($token)) { // simple 1-character token $lines .= $token; - } - else + } + else { // token array list($id, $text) = $token; - switch ($id) - { - case T_COMMENT: + switch ($id) + { + case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments @@ -265,4 +265,3 @@ class HTMLCoverageReport extends HtmlReporter } } -?> -- cgit v1.2.3