MDL-83634 tool_brickfield: Test the image alt text check's severity

This commit is contained in:
Jun Pataleta
2025-03-12 13:22:22 +08:00
parent 9ac7aa2b16
commit dd696fc542
@@ -24,6 +24,8 @@
namespace tool_brickfield\local\htmlchecker\common\checks;
use tool_brickfield\local\htmlchecker\brickfield_accessibility;
defined('MOODLE_INTERNAL') || die();
require_once('all_checks.php');
@@ -99,4 +101,15 @@ EOD;
$this->assertEquals('img', $results[0]->element->tagName);
}
}
/**
* Test the severity of the {@see img_alt_is_too_long} check.
*
* @return void
*/
public function test_severity(): void {
$html = $this->get_test_html('Some alt text');
$checker = new brickfield_accessibility($html, 'brickfield', 'string');
$this->assertEquals(brickfield_accessibility::BA_TEST_SUGGESTION, $checker->get_test_severity(img_alt_is_too_long::class));
}
}