feat: add 15 new WCAG rules, dynamic ARIA checks and bump version to v3.1.4

This commit is contained in:
Enes Yakıştır
2026-07-30 20:34:41 +03:00
parent 164828f9f7
commit 58b1618d96
31 changed files with 1138 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace YakNet\AccessibilityConsole\Tests\Rules;
use PHPUnit\Framework\TestCase;
use YakNet\AccessibilityConsole\Core\Scanner;
use YakNet\AccessibilityConsole\Rules\AriaPressedToggle;
class AriaPressedToggleTest extends TestCase
{
public function testFlagsToggleButtonWithoutAriaPressed(): void
{
$scanner = new Scanner();
$scanner->addRule(new AriaPressedToggle());
$violations = $scanner->scan('<button class="btn-toggle">Mute</button>');
$this->assertCount(1, $violations);
$this->assertSame('WCAG_4_1_2_TOGGLE_BUTTON_STATE', $violations[0]->ruleId);
}
public function testPassesToggleButtonWithAriaPressed(): void
{
$scanner = new Scanner();
$scanner->addRule(new AriaPressedToggle());
$violations = $scanner->scan('<button class="btn-toggle" aria-pressed="false">Mute</button>');
$this->assertCount(0, $violations);
}
}