addRule(new RoleImgAlt()); $violations = $scanner->scan('
'); $this->assertCount(1, $violations); $this->assertSame('WCAG_1_1_1_ROLE_IMG', $violations[0]->ruleId); } public function testPassesRoleImgWithAriaLabel(): void { $scanner = new Scanner(); $scanner->addRule(new RoleImgAlt()); $violations = $scanner->scan('
'); $this->assertCount(0, $violations); } public function testPassesRoleImgWithAriaHidden(): void { $scanner = new Scanner(); $scanner->addRule(new RoleImgAlt()); $violations = $scanner->scan('
'); $this->assertCount(0, $violations); } }