addRule(new ColorBlindnessContrast());
// Red text #ff0000 on Green background #00ff00 (Classic red/green colorblindness issue)
$violations = $scanner->scan('
Red on Green text
');
$this->assertGreaterThanOrEqual(1, count($violations));
$this->assertSame('WCAG_1_4_1_COLOR_BLINDNESS_CONTRAST', $violations[0]->ruleId);
}
public function testPassesHighContrastUnderColorBlindnessSimulation(): void
{
$scanner = new Scanner();
$scanner->addRule(new ColorBlindnessContrast());
// Black text #000000 on White background #ffffff
$violations = $scanner->scan('Black on White text
');
$this->assertCount(0, $violations);
}
}