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(v4.0.0): 175 WCAG 2.2 & ARIA rules, VPAT 2.5, 11 presets, PolicyEngine, inline suppressions, cache, CI generator, PHPUnit assertions, and open-source YakNet identity
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace YakNet\AccessibilityConsole\Tests\Reporting;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use YakNet\AccessibilityConsole\Core\Severity;
|
||||
use YakNet\AccessibilityConsole\Core\Violation;
|
||||
use YakNet\AccessibilityConsole\Core\WCAGStandard;
|
||||
use YakNet\AccessibilityConsole\Reporting\CheckstyleFormatter;
|
||||
|
||||
class CheckstyleFormatterTest extends TestCase
|
||||
{
|
||||
public function testRendersValidCheckstyleXml(): void
|
||||
{
|
||||
$formatter = new CheckstyleFormatter();
|
||||
$violations = [
|
||||
new Violation(
|
||||
ruleId: 'WCAG_1_1_1_ALT',
|
||||
message: 'Image missing alt attribute',
|
||||
severity: Severity::ERROR,
|
||||
standard: WCAGStandard::A,
|
||||
htmlSnippet: '<img src="a.png">',
|
||||
location: ['file' => 'views/home.blade.php', 'line' => 14, 'column' => 5]
|
||||
),
|
||||
new Violation(
|
||||
ruleId: 'WCAG_2_5_8_TARGET_SIZE',
|
||||
message: 'Button too small',
|
||||
severity: Severity::WARNING,
|
||||
standard: WCAGStandard::AA,
|
||||
htmlSnippet: '<button>X</button>',
|
||||
location: ['file' => 'views/home.blade.php', 'line' => 22, 'column' => 3]
|
||||
),
|
||||
];
|
||||
|
||||
$xml = $formatter->render($violations);
|
||||
|
||||
$this->assertStringContainsString('<?xml version="1.0" encoding="UTF-8"?>', $xml);
|
||||
$this->assertStringContainsString('<checkstyle version="4.0.0">', $xml);
|
||||
$this->assertStringContainsString('<file name="views/home.blade.php">', $xml);
|
||||
$this->assertStringContainsString('source="YakNet.Accessibility.WCAG_1_1_1_ALT"', $xml);
|
||||
$this->assertStringContainsString('severity="warning"', $xml);
|
||||
|
||||
$dom = new \DOMDocument();
|
||||
$this->assertTrue($dom->loadXML($xml));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user