addRule(new ImageAltPlaceholder());
$violations = $scanner->scan('
');
$this->assertCount(1, $violations);
$this->assertSame('WCAG_1_1_1_ALT_PLACEHOLDER', $violations[0]->ruleId);
}
public function testFlagsFilenameAltText(): void
{
$scanner = new Scanner();
$scanner->addRule(new ImageAltPlaceholder());
$violations = $scanner->scan('');
$this->assertCount(1, $violations);
$this->assertSame('WCAG_1_1_1_ALT_PLACEHOLDER', $violations[0]->ruleId);
}
public function testPassesDescriptiveAltText(): void
{
$scanner = new Scanner();
$scanner->addRule(new ImageAltPlaceholder());
$violations = $scanner->scan('');
$this->assertCount(0, $violations);
}
public function testPassesEmptyAlt(): void
{
$scanner = new Scanner();
$scanner->addRule(new ImageAltPlaceholder());
$violations = $scanner->scan('');
$this->assertCount(0, $violations);
}
}