reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+8 -7
View File
@@ -10,6 +10,7 @@ use App\Models\ClassSection;
use App\Models\Configuration;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Sanctum\Sanctum;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class AssignmentApiTest extends TestCase
@@ -39,7 +40,7 @@ class AssignmentApiTest extends TestCase
);
}
/** @test */
#[Test]
public function it_returns_assignment_sections_json(): void
{
$section = ClassSection::factory()->create([
@@ -108,7 +109,7 @@ class AssignmentApiTest extends TestCase
$response->assertJsonPath('classSections.0.students.0.id', $student->id);
}
/** @test */
#[Test]
public function it_filters_assignments_by_school_year(): void
{
$section1 = ClassSection::factory()->create(['name' => 'Grade 4']);
@@ -144,7 +145,7 @@ class AssignmentApiTest extends TestCase
$response->assertJsonPath('selectedYear', '2025-2026');
}
/** @test */
#[Test]
public function it_creates_or_updates_student_assignment(): void
{
$student = Student::factory()->create(['is_active' => 1]);
@@ -171,7 +172,7 @@ class AssignmentApiTest extends TestCase
]);
}
/** @test */
#[Test]
public function it_validates_required_fields_when_storing_assignment(): void
{
$response = $this->postJson('/api/assignments', []);
@@ -183,7 +184,7 @@ class AssignmentApiTest extends TestCase
]);
}
/** @test */
#[Test]
public function store_is_idempotent_for_same_student_semester_and_year(): void
{
$student = Student::factory()->create(['is_active' => 1]);
@@ -224,7 +225,7 @@ class AssignmentApiTest extends TestCase
]);
}
/** @test */
#[Test]
public function guest_cannot_access_assignment_api_when_auth_is_required(): void
{
auth()->guard('sanctum')->logout();
@@ -233,4 +234,4 @@ class AssignmentApiTest extends TestCase
$response->assertStatus(401);
}
}
}