This commit is contained in:
Ilya Tregubov 2024-07-18 10:29:08 +08:00
commit 00376925b2
3 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<COMPATIBILITY_MATRIX>
<PLUGIN name="filter_tidy">
<PHP_EXTENSIONS>
<PHP_EXTENSION name="tidy" level="optional">
<FEEDBACK>
<ON_CHECK message="tidyextensionrequired" plugin="filter_tidy" />
</FEEDBACK>
</PHP_EXTENSION>
</PHP_EXTENSIONS>
</PLUGIN>
</COMPATIBILITY_MATRIX>

View File

@ -25,3 +25,4 @@
$string['filtername'] = 'HTML tidy';
$string['privacy:metadata'] = 'The HTML tidy plugin does not store any personal data.';
$string['tidyextensionrequired'] = 'In order to use this filter, the \'tidy\' PHP extension must be installed';

View File

@ -26,7 +26,7 @@ use environment_results;
* @copyright 2013 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class environment_test extends \advanced_testcase {
final class environment_test extends \advanced_testcase {
/**
* Test the environment check status.
@ -47,7 +47,7 @@ class environment_test extends \advanced_testcase {
*
* @return array
*/
public function environment_provider() {
public static function environment_provider(): array {
global $CFG;
require_once($CFG->libdir.'/environmentlib.php');
@ -75,6 +75,13 @@ class environment_test extends \advanced_testcase {
$this->markTestSkipped('OPCache extension is not necessary for unit testing.');
}
if ($result->part === 'php_extension'
&& $result->getPluginName() !== ''
&& $result->getLevel() === 'optional'
&& $result->getStatus() === false) {
$this->markTestSkipped('Optional plugin extension is not necessary for unit testing.');
}
if ($result->part === 'custom_check'
&& $result->getLevel() === 'optional'
&& $result->getStatus() === false) {