28 lines
828 B
PHP
28 lines
828 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services\Assignment;
|
|
|
|
use App\Models\Configuration;
|
|
use App\Services\Assignment\AssignmentContextService;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Tests\TestCase;
|
|
|
|
class AssignmentContextServiceTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_get_current_term_values(): void
|
|
{
|
|
DB::table('configuration')->insert([
|
|
['id' => 1, 'config_key' => 'school_year', 'config_value' => '2025-2026'],
|
|
['id' => 2, 'config_key' => 'semester', 'config_value' => 'Fall'],
|
|
]);
|
|
|
|
$service = new AssignmentContextService(new Configuration());
|
|
|
|
$this->assertSame('Fall', $service->getCurrentSemester());
|
|
$this->assertSame('2025-2026', $service->getCurrentSchoolYear());
|
|
}
|
|
}
|