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.3.0): enterprise presets, badges, notifications, rule controller, watch mode, offline healer, and WCAG 2.2 ruleset
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace YakNet\AccessibilityConsole\Tests\Reporting;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use YakNet\AccessibilityConsole\Core\Severity;
|
||||
use YakNet\AccessibilityConsole\Core\Violation;
|
||||
use YakNet\AccessibilityConsole\Core\WCAGStandard;
|
||||
use YakNet\AccessibilityConsole\Reporting\JunitFormatter;
|
||||
|
||||
class JunitFormatterTest extends TestCase
|
||||
{
|
||||
public function testRendersValidJunitXmlWithViolations(): void
|
||||
{
|
||||
$formatter = new JunitFormatter();
|
||||
$violations = [
|
||||
new Violation(
|
||||
'WCAG_1_1_1_IMG_ALT',
|
||||
'Images must have alternative text.',
|
||||
Severity::ERROR,
|
||||
WCAGStandard::A,
|
||||
'<img src="photo.png">',
|
||||
['file' => 'views/index.php', 'line' => 10, 'column' => 2]
|
||||
),
|
||||
];
|
||||
|
||||
$xml = $formatter->render($violations);
|
||||
$this->assertStringContainsString('<?xml version="1.0" encoding="UTF-8"?>', $xml);
|
||||
$this->assertStringContainsString('<testsuites', $xml);
|
||||
$this->assertStringContainsString('failures="1"', $xml);
|
||||
$this->assertStringContainsString('<failure', $xml);
|
||||
$this->assertStringContainsString('WCAG_1_1_1_IMG_ALT', $xml);
|
||||
|
||||
// Verify valid XML parsing
|
||||
$dom = new \DOMDocument();
|
||||
$this->assertTrue($dom->loadXML($xml));
|
||||
}
|
||||
|
||||
public function testRendersCleanXmlWhenEmpty(): void
|
||||
{
|
||||
$formatter = new JunitFormatter();
|
||||
$input = new ArrayInput([]);
|
||||
$output = new BufferedOutput();
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$exitCode = $formatter->format([], 0, $io);
|
||||
$this->assertSame(0, $exitCode);
|
||||
|
||||
$xml = $output->fetch();
|
||||
$this->assertStringContainsString('failures="0"', $xml);
|
||||
$this->assertStringContainsString('AccessibilityCompliant', $xml);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user