addRule(new ImageAltPlaceholder()); $violations = $scanner->scan('
logo
'); $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('
header_banner.jpg
'); $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('
YakNet Static Analysis Console Banner Image
'); $this->assertCount(0, $violations); } public function testPassesEmptyAlt(): void { $scanner = new Scanner(); $scanner->addRule(new ImageAltPlaceholder()); $violations = $scanner->scan('
'); $this->assertCount(0, $violations); } }