28 lines
725 B
PHP
28 lines
725 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services\ClassProgress;
|
|
|
|
use App\Services\ClassProgress\ClassProgressRuleService;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ClassProgressRuleServiceTest extends TestCase
|
|
{
|
|
public function test_build_unit_chapter_summary_limits_length(): void
|
|
{
|
|
$service = new ClassProgressRuleService;
|
|
|
|
$summary = $service->buildUnitChapterSummary(['Unit 1'], ['Chapter A']);
|
|
|
|
$this->assertSame('Unit 1 / Chapter A', $summary);
|
|
}
|
|
|
|
public function test_ensure_week_end_defaults_to_six_days(): void
|
|
{
|
|
$service = new ClassProgressRuleService;
|
|
|
|
$weekEnd = $service->ensureWeekEnd('2025-09-07', null);
|
|
|
|
$this->assertSame('2025-09-13', $weekEnd);
|
|
}
|
|
}
|