Merge branch 'MDL-72701-master' of https://github.com/andrewnicols/moodle
This commit is contained in:
@@ -68,6 +68,19 @@ class phpunit_coverage_info {
|
||||
final public function get_includelists(string $plugindir) : array {
|
||||
$coverages = [];
|
||||
|
||||
$includelistfolders = array_merge([
|
||||
'classes',
|
||||
'tests/generator',
|
||||
], $this->includelistfolders);;
|
||||
|
||||
$includelistfiles = array_merge([
|
||||
'externallib.php',
|
||||
'lib.php',
|
||||
'locallib.php',
|
||||
'renderer.php',
|
||||
'rsslib.php',
|
||||
], $this->includelistfiles);
|
||||
|
||||
if (!empty($plugindir)) {
|
||||
$plugindir .= "/";
|
||||
|
||||
@@ -79,21 +92,16 @@ class phpunit_coverage_info {
|
||||
"Please, replace them with \$includelistfolders and " .
|
||||
"\$includelistfiles in {$plugindir}tests/coverage.php\n";
|
||||
|
||||
foreach ($this->whitelistfolders as $folder) {
|
||||
$coverages[] = html_writer::tag('directory', "{$plugindir}{$folder}", ['suffix' => '.php']);
|
||||
}
|
||||
|
||||
foreach ($this->whitelistfiles as $file) {
|
||||
$coverages[] = html_writer::tag('file', "{$plugindir}{$file}");
|
||||
}
|
||||
$includelistfolders = array_merge($includelistfolders, $this->whitelistfolders);
|
||||
$includelistfiles = array_merge($includelistfiles, $this->whitelistfiles);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->includelistfolders as $folder) {
|
||||
foreach ($includelistfolders as $folder) {
|
||||
$coverages[] = html_writer::tag('directory', "{$plugindir}{$folder}", ['suffix' => '.php']);
|
||||
}
|
||||
|
||||
foreach ($this->includelistfiles as $file) {
|
||||
foreach ($includelistfiles as $file) {
|
||||
$coverages[] = html_writer::tag('file', "{$plugindir}{$file}");
|
||||
}
|
||||
|
||||
|
||||
@@ -973,7 +973,7 @@ class phpunit_util extends testing_util {
|
||||
* @param string $fulldir The directory to find the coverage info file in.
|
||||
* @return phpunit_coverage_info
|
||||
*/
|
||||
protected static function get_coverage_info(string $fulldir): ?phpunit_coverage_info {
|
||||
protected static function get_coverage_info(string $fulldir): phpunit_coverage_info {
|
||||
$coverageconfig = "{$fulldir}/tests/coverage.php";
|
||||
if (file_exists($coverageconfig)) {
|
||||
$coverageinfo = require($coverageconfig);
|
||||
@@ -984,7 +984,7 @@ class phpunit_util extends testing_util {
|
||||
return $coverageinfo;
|
||||
}
|
||||
|
||||
return null;
|
||||
return new phpunit_coverage_info();;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ use org\bovigo\vfs\vfsStream;
|
||||
/**
|
||||
* Test phpunit_dataset features.
|
||||
*
|
||||
* @coversDefaultClass phpunit_dataset
|
||||
* @coversDefaultClass \phpunit_dataset
|
||||
*/
|
||||
class phpunit_dataset_test extends advanced_testcase {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user