This is not contrasty enough.
+ + +EOD; + + /** @var string HTML that should get flagged. */ + private $htmlfail2 = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML that should get flagged. */ + private $htmlfail3 = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML that should get flagged. */ + private $htmlfail4 = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML that should get flagged. */ + private $htmlfail5 = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML that should get flagged. */ + private $htmlfail6 = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML with invalid colour names. */ + private $invalidcolours = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML with invalid colour numeric values. */ + private $invalidvalue = <<This is not contrasty enough.
+ + +EOD; + + /** @var string HTML with empty colour values. */ + private $emptyvalue = <<This is not contrasty enough.
+ + +EOD; + /** * Test for the area assign intro */ public function test_check() { - $results = $this->get_checker_results($this->htmlfail); + $results = $this->get_checker_results($this->htmlfail1); + $this->assertTrue($results[0]->element->tagName == 'p'); + + $results = $this->get_checker_results($this->htmlfail2); + $this->assertTrue($results[0]->element->tagName == 'p'); + + $results = $this->get_checker_results($this->htmlfail3); + $this->assertTrue($results[0]->element->tagName == 'p'); + + $results = $this->get_checker_results($this->htmlfail4); + $this->assertTrue($results[0]->element->tagName == 'p'); + + $results = $this->get_checker_results($this->htmlfail5); + $this->assertTrue($results[0]->element->tagName == 'p'); + + $results = $this->get_checker_results($this->htmlfail6); $this->assertTrue($results[0]->element->tagName == 'p'); $results = $this->get_checker_results($this->htmlpass); $this->assertEmpty($results); } + + /** + * Test with valid colour names. + */ + public function test_check_for_namedcolours() { + $results = $this->get_checker_results($this->namecolours); + $this->assertTrue($results[0]->element->tagName == 'p'); + } + + /** + * Test with invalid colour names. + */ + public function test_check_for_invalidcolours() { + $results = $this->get_checker_results($this->invalidcolours); + $this->assertTrue($results[0]->element->tagName == 'p'); + } + + /** + * Test with invalid colour numeric values. + */ + public function test_check_for_invalidvalues() { + $results = $this->get_checker_results($this->invalidvalue); + $this->assertTrue($results[0]->element->tagName == 'p'); + } + + /** + * Test with empty colour values. + */ + public function test_check_for_emptyvalues() { + $results = $this->get_checker_results($this->emptyvalue); + $this->assertEmpty($results); + } } diff --git a/admin/tool/brickfield/upgrade.txt b/admin/tool/brickfield/upgrade.txt new file mode 100644 index 00000000000..c3459ce38ba --- /dev/null +++ b/admin/tool/brickfield/upgrade.txt @@ -0,0 +1,6 @@ +This files describes API changes in /admin/tool/brickfield/*. + +=== 4.0 === + +* classes/local/htmlchecker/common/brickfield_accessibility_color_test::get_rgb() has been modified to return either an + array or null. Previously it returned either an array or false.