Integrasi Login dan menu Dasar SIAKAD Operator dan Mahasiswa

This commit is contained in:
Ariyutta
2026-11-02 09:08:03 +07:00
parent b7a0c8705b
commit 43269095bf
68 changed files with 4287 additions and 216 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Tests\Unit;
use App\Support\GradeTone;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
class GradeToneTest extends TestCase
{
/** @return array<string, array{string|null, string}> */
public static function grades(): array
{
return [
'A' => ['A', 'success'],
'A-' => ['A-', 'success'],
'B+' => ['B+', 'info'],
'B' => ['B', 'info'],
'B-' => ['B-', 'info'],
'C+' => ['C+', 'gold'],
'C' => ['C', 'gold'],
'C-' => ['C-', 'gold'],
'D+' => ['D+', 'violet'],
'D' => ['D', 'violet'],
'E' => ['E', 'danger'],
'E+' => ['E+', 'danger'],
'huruf kecil berspasi' => [' b+ ', 'info'],
'kosong' => [null, 'neutral'],
'tak dikenal' => ['T', 'neutral'],
];
}
#[DataProvider('grades')]
public function test_grade_letter_maps_to_badge_tone(?string $grade, string $tone): void
{
$this->assertSame($tone, GradeTone::for($grade));
}
}