Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat(v3.2.7): expand WCAG ruleset to 127 rules, add HTML syntax linter, single-pass rule engine, template preprocessor, and accessibility analytics
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace YakNet\AccessibilityConsole\Tests\Core;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use YakNet\AccessibilityConsole\Core\Locator\PreciseElementLocator;
|
||||
|
||||
class PreciseElementLocatorTest extends TestCase
|
||||
{
|
||||
private PreciseElementLocator $locator;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->locator = new PreciseElementLocator();
|
||||
}
|
||||
|
||||
public function testLocatesExactMatch(): void
|
||||
{
|
||||
$content = "<html>\n<body>\n<div class=\"container\">\n<img src=\"logo.png\">\n</div>\n</body>\n</html>";
|
||||
$snippet = '<img src="logo.png">';
|
||||
|
||||
$loc = $this->locator->locate($content, $snippet);
|
||||
$this->assertSame(4, $loc['line']);
|
||||
}
|
||||
|
||||
public function testLocatesAttributeTokenMatch(): void
|
||||
{
|
||||
$content = "<div>\n<button id=\"save-btn\" class=\"btn btn-primary\">\nSave\n</button>\n</div>";
|
||||
// Snippet with different whitespace/attr arrangement
|
||||
$snippet = '<button class="btn btn-primary" id="save-btn">';
|
||||
|
||||
$loc = $this->locator->locate($content, $snippet);
|
||||
$this->assertSame(2, $loc['line']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace YakNet\AccessibilityConsole\Tests\Core;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use YakNet\AccessibilityConsole\Core\RuleRegistry;
|
||||
use YakNet\AccessibilityConsole\Rules\RuleLevels;
|
||||
|
||||
class RuleRegistryTest extends TestCase
|
||||
{
|
||||
public function testValidateRuleSetHasZeroDuplicates(): void
|
||||
{
|
||||
$rules = RuleLevels::getRulesForLevel(9);
|
||||
$result = RuleRegistry::validate($rules);
|
||||
|
||||
$this->assertTrue($result['valid'], 'Rule validation failed: ' . implode("\n", $result['errors']));
|
||||
$this->assertEmpty($result['errors']);
|
||||
$this->assertGreaterThanOrEqual(120, $result['count']);
|
||||
}
|
||||
|
||||
public function testGetMetadataReturnsAccurateData(): void
|
||||
{
|
||||
$rules = RuleLevels::getRulesForLevel(1);
|
||||
$firstRule = $rules[0];
|
||||
$meta = RuleRegistry::getMetadata($firstRule);
|
||||
|
||||
$this->assertArrayHasKey('id', $meta);
|
||||
$this->assertArrayHasKey('class', $meta);
|
||||
$this->assertArrayHasKey('severity', $meta);
|
||||
$this->assertArrayHasKey('standard', $meta);
|
||||
$this->assertArrayHasKey('level', $meta);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user