fix financial and certificates

This commit is contained in:
root
2026-06-05 01:51:08 -04:00
parent d28d11e2e5
commit ad968eaff7
94 changed files with 9654 additions and 214 deletions
@@ -0,0 +1,37 @@
<?php
namespace Tests\Unit\Grading;
use App\Services\Grading\Validation\ScoreValueValidator;
use InvalidArgumentException;
use PHPUnit\Framework\TestCase;
class ScoreValueValidatorTest extends TestCase
{
public function test_blank_score_remains_null(): void
{
$validator = new ScoreValueValidator();
$this->assertNull($validator->normalizeNullable('', 100));
$this->assertNull($validator->normalizeNullable(null, 100));
}
public function test_score_must_be_inside_range(): void
{
$validator = new ScoreValueValidator();
$this->assertSame(95.0, $validator->normalizeNullable('95', 100));
$this->expectException(InvalidArgumentException::class);
$validator->normalizeNullable(101, 100);
}
public function test_status_inference_preserves_legacy_pending_behavior(): void
{
$validator = new ScoreValueValidator();
$this->assertSame('scored', $validator->inferStatus(80.0));
$this->assertSame('pending', $validator->inferStatus(null, false));
$this->assertSame('excused', $validator->inferStatus(null, true));
}
}