Files
archived-presentations/slides/xdebug/ccoverage2.xml
Derick Rethans b7f445af4c - Commited presentations for:
OSCOM 4: Localization
  OSCOM 4: Performance
  php|works 4: Localization
2004-09-13 13:41:19 +00:00

36 lines
834 B
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<slide fontsize="6em">
<title>Code Coverage</title>
<subtitle>The Testing Application</subtitle>
<example class="bit_larger"><![CDATA[<?php
echo "Output:\n\n";
xdebug_start_code_coverage();
include 'tests/basic.t';
$cc = xdebug_get_code_coverage();
xdebug_stop_code_coverage();
$clean = array();
$clean[$test] = $cc[$test];
foreach ($clean as $file => $cc) {
echo "<pre>";
$fc = file($file);
$line_nos = array_keys($cc);
foreach ($fc as $ln => $line) {
if (in_array($ln + 1, $line_nos)) {
$bgc = "aaaaaa";
} else {
$bgc = "dddddd";
}
echo "<div style='background-color: #$bgc'>";
echo @sprintf("%3d [%2d]:\t", $ln + 1, $cc[$ln + 1]);
echo htmlspecialchars($line);
echo "</div>";
}
echo "</pre>";
}
?>]]></example>
<break />
</slide>