- Split testLoginLogout() into testBadLogin() and testLoginLogout(). - Mark testCreateSimpleArticle() as incomplete until the popup window opened by clicking on VIEW is handled correctly. - Disable mod_rewrite so that the test suite does not depend on it. - Remove superfluous check for Testing_Selenium class. - Migrate TestConfiguration.php.dist to config.xml.dist. - Configure whitelist for code coverage information. - Be conservative for now and only add include/ and plugins/ directories for now. - Set addUncoveredFilesFromWhitelist="false" because not all files are loadable (yet). - Add documentation for code coverage reporting.
37 lines
1021 B
PHP
37 lines
1021 B
PHP
<?php
|
|
require_once 'PHPUnit/Util/FilterIterator.php';
|
|
|
|
if (isset($_GET['PHPUNIT_SELENIUM_TEST_ID'])) {
|
|
$files = new PHPUnit_Util_FilterIterator(
|
|
new RecursiveIteratorIterator(
|
|
new RecursiveDirectoryIterator(dirname(__FILE__))
|
|
),
|
|
'.phpunit_' . $_GET['PHPUNIT_SELENIUM_TEST_ID']
|
|
);
|
|
|
|
$coverage = array();
|
|
|
|
foreach ($files as $file) {
|
|
$filename = $file->getPathName();
|
|
|
|
$data = eval('return ' . file_get_contents($filename) . ';');
|
|
unset($filename);
|
|
|
|
foreach ($data as $filename => $lines) {
|
|
if (!isset($coverage[$filename])) {
|
|
$coverage[$filename] = $lines;
|
|
} else {
|
|
foreach ($lines as $line => $flag) {
|
|
if (!isset($coverage[$filename][$line]) ||
|
|
$flag > $coverage[$filename][$line]) {
|
|
$coverage[$filename][$line] = $flag;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var_export($coverage);
|
|
}
|
|
?>
|