Hello

execute([]); $this->assertSame(0, $exitCode); $output = $tester->getDisplay(); $this->assertStringContainsString('175 rules registered', $output); $this->assertStringContainsString('VALID (0 conflicts)', $output); $this->assertStringContainsString('11 profiles available', $output); } public function testExplainCommandDisplaysRuleAndWcagGuidance(): void { $tester = new CommandTester(new ExplainCommand()); $exitCode = $tester->execute(['rule' => 'WCAG_4_1_2_ARIA_TABLIST']); $this->assertSame(0, $exitCode); $output = $tester->getDisplay(); $this->assertStringContainsString('WCAG_4_1_2_ARIA_TABLIST', $output); $this->assertStringContainsString('W3C WCAG Guidance', $output); $this->assertStringContainsString('Non-Compliant Example', $output); } public function testPresetsCommandListsAllElevenPresets(): void { $tester = new CommandTester(new PresetsCommand()); $exitCode = $tester->execute([]); $this->assertSame(0, $exitCode); $output = $tester->getDisplay(); $this->assertStringContainsString('wcag22-aa', $output); $this->assertStringContainsString('eaa2025', $output); $this->assertStringContainsString('government', $output); $this->assertStringContainsString('Total compliance presets available: 11', $output); } public function testRulesCommandHealableAndPrincipleFilters(): void { $tester = new CommandTester(new RulesCommand()); $exitCode = $tester->execute(['--healable' => true]); $this->assertSame(0, $exitCode); $output = $tester->getDisplay(); $this->assertStringContainsString('WCAG_3_2_2_BUTTON_TYPE', $output); $this->assertStringContainsString('Showing', $output); $exitCode2 = $tester->execute(['--principle' => 'Operable']); $this->assertSame(0, $exitCode2); $this->assertStringContainsString('WCAG_2_', $tester->getDisplay()); } public function testVpatCommandOutputsMarkdownReport(): void { $tmpHtml = sys_get_temp_dir() . '/yaknet_vpat_' . uniqid() . '.html'; file_put_contents($tmpHtml, '

', 'location' => ['file' => 'index.html', 'line' => 10]],
]));
try {
$tester = new CommandTester(new CompareCommand());
$exitCode = $tester->execute([
'before' => $beforeFile,
'after' => $afterFile,
'--fail-on-regression' => true,
]);
$this->assertSame(1, $exitCode);
$this->assertStringContainsString('REGRESSION', $tester->getDisplay());
$this->assertStringContainsString('WCAG_1_1_1_ALT', $tester->getDisplay());
} finally {
@unlink($beforeFile);
@unlink($afterFile);
}
}
}