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
36 lines
1.3 KiB
PHP
36 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace YakNet\AccessibilityConsole\Tests\Analytics;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use YakNet\AccessibilityConsole\Analytics\AccessibilityTelemetry;
|
|
use YakNet\AccessibilityConsole\Core\Severity;
|
|
use YakNet\AccessibilityConsole\Core\Violation;
|
|
use YakNet\AccessibilityConsole\Core\WCAGStandard;
|
|
|
|
class AccessibilityTelemetryTest extends TestCase
|
|
{
|
|
private AccessibilityTelemetry $telemetry;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
$this->telemetry = new AccessibilityTelemetry();
|
|
}
|
|
|
|
public function testComputesDefectDensityAndRatios(): void
|
|
{
|
|
$violations = [
|
|
new Violation(ruleId: 'R1', message: 'M1', severity: Severity::ERROR, standard: WCAGStandard::A),
|
|
new Violation(ruleId: 'R2', message: 'M2', severity: Severity::WARNING, standard: WCAGStandard::AA),
|
|
];
|
|
|
|
$metrics = $this->telemetry->computeMetrics($violations, 2000);
|
|
|
|
$this->assertSame(2, $metrics['total_violations']);
|
|
$this->assertSame(1, $metrics['error_count']);
|
|
$this->assertSame(1, $metrics['warning_count']);
|
|
$this->assertSame(1.0, $metrics['defect_density_per_kloc']); // 2 violations / 2 kloc = 1.0
|
|
$this->assertSame(50.0, $metrics['critical_blockers_ratio']); // 1 / 2 = 50%
|
|
}
|
|
}
|