release: v3.2.0 - Enterprise Edition with Live Web Dashboard, PDF/Excel Exporters, Framework Stubs & 110 WCAG Rules

This commit is contained in:
Enes Yakıştır
2026-07-31 00:13:31 +03:00
parent 58b1618d96
commit 73fbf485d2
36 changed files with 1420 additions and 11 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace YakNet\AccessibilityConsole\Stubs\Laravel;
use YakNet\AccessibilityConsole\Core\Scanner;
trait AssertsAccessibility
{
/**
* Assert that an HTML response or URL passes minimum WCAG accessibility health score.
*/
public function assertPageIsAccessible(string $htmlOrUrl, int $minScore = 80): void
{
$scanner = new Scanner();
$result = str_starts_with($htmlOrUrl, 'http')
? $scanner->scanUrl($htmlOrUrl)
: $scanner->scan($htmlOrUrl);
$score = intval($result['score'] ?? 0);
$violations = count($result['violations'] ?? []);
$message = sprintf('Target failed accessibility audit with score %d/100 (%d violations).', $score, $violations);
/** @var \PHPUnit\Framework\TestCase $this */
$this->assertGreaterThanOrEqual($minScore, $score, $message);
}
}