addRule(new TextSpacing()); $html = '
This text has insufficient line height.
'; $violations = $scanner->scan($html); $this->assertCount(1, $violations); $this->assertSame('WCAG_1_4_12_TEXT_SPACING', $violations[0]->ruleId); } public function testPassesAdequateLineHeight(): void { $scanner = new Scanner(); $scanner->addRule(new TextSpacing()); $html = 'Proper line height content.
'; $violations = $scanner->scan($html); $this->assertCount(0, $violations); } public function testFlagsFixedHeightWithOverflowHiddenOnText(): void { $scanner = new Scanner(); $scanner->addRule(new TextSpacing()); $html = ''; $violations = $scanner->scan($html); $this->assertCount(1, $violations); } }