addRule(new FocusableWithoutRole());
$violations = $scanner->scan('
Click me
');
$this->assertCount(1, $violations);
$this->assertSame('WCAG_4_1_2_FOCUSABLE_ROLE', $violations[0]->ruleId);
}
public function testPassesFocusableDivWithRole(): void
{
$scanner = new Scanner();
$scanner->addRule(new FocusableWithoutRole());
$violations = $scanner->scan('Click me
');
$this->assertCount(0, $violations);
}
public function testPassesNegativeTabindexDiv(): void
{
$scanner = new Scanner();
$scanner->addRule(new FocusableWithoutRole());
$violations = $scanner->scan('Programmatic focus only
');
$this->assertCount(0, $violations);
}
}