release: v3.1.0 premium smart core engines and 14 new accessibility rules

This commit is contained in:
Enes Yakıştır
2026-07-13 10:54:25 +03:00
parent 7f3bf3cb7d
commit 5292c2c865
67 changed files with 2639 additions and 29 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\AriaLabelledbyExists;
class AriaLabelledbyExistsTest extends TestCase
{
public function testFlagsMissingAriaLabelTarget(): void
{
$scanner = new Scanner();
$scanner->addRule(new AriaLabelledbyExists());
$violations = $scanner->scan('<div><button aria-labelledby="non_existent_id">Submit</button></div>');
$this->assertCount(1, $violations);
$this->assertSame('WCAG_4_1_2_ARIA_LABELLEDBY', $violations[0]->ruleId);
}
public function testPassesExistingAriaLabelTarget(): void
{
$scanner = new Scanner();
$scanner->addRule(new AriaLabelledbyExists());
$violations = $scanner->scan('<div><div id="real_id">Label</div><button aria-labelledby="real_id">Submit</button></div>');
$this->assertCount(0, $violations);
}
}