fix logic and tests, update docker CI file
This commit is contained in:
@@ -89,7 +89,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -98,7 +98,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherAssistant->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'ta',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -107,7 +107,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Morning group',
|
||||
@@ -125,7 +125,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
->assertJsonPath('data.semester', 'Fall')
|
||||
->assertJsonPath('data.current_school_year', '2025-2026')
|
||||
->assertJsonCount(1, 'data.classSections')
|
||||
->assertJsonPath('data.classSections.0.class_section_id', $this->sectionA->id)
|
||||
->assertJsonPath('data.classSections.0.class_section_id', $this->sectionA->class_section_id)
|
||||
->assertJsonPath('data.classSections.0.class_section_name', 'Grade 1 - A')
|
||||
->assertJsonPath('data.classSections.0.main_teachers.0', 'Main Teacher')
|
||||
->assertJsonPath('data.classSections.0.teacher_assistants.0', 'Assistant Teacher')
|
||||
@@ -140,7 +140,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -149,7 +149,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherAssistant->id,
|
||||
'class_section_id' => $this->sectionB->id,
|
||||
'class_section_id' => $this->sectionB->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2024-2025',
|
||||
@@ -158,7 +158,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Included',
|
||||
@@ -167,7 +167,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $this->studentTwo->id,
|
||||
'class_section_id' => $this->sectionB->id,
|
||||
'class_section_id' => $this->sectionB->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2024-2025',
|
||||
'description' => 'Excluded',
|
||||
@@ -186,7 +186,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionB->id,
|
||||
'class_section_id' => $this->sectionB->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -195,7 +195,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherAssistant->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -224,7 +224,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -233,7 +233,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $inactiveStudent->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Should not show',
|
||||
@@ -251,7 +251,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
$payload = [
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'New assignment',
|
||||
@@ -263,14 +263,14 @@ class AssignmentApiControllerTest extends TestCase
|
||||
$response->assertCreated()
|
||||
->assertJsonPath('message', 'Assignment saved successfully.')
|
||||
->assertJsonPath('data.student_id', $this->studentOne->id)
|
||||
->assertJsonPath('data.class_section_id', $this->sectionA->id)
|
||||
->assertJsonPath('data.class_section_id', $this->sectionA->class_section_id)
|
||||
->assertJsonPath('data.semester', 'Fall')
|
||||
->assertJsonPath('data.school_year', '2025-2026')
|
||||
->assertJsonPath('data.description', 'New assignment');
|
||||
|
||||
$this->assertDatabaseHas('student_class', [
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'New assignment',
|
||||
@@ -282,7 +282,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Old description',
|
||||
@@ -291,7 +291,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
$payload = [
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Updated description',
|
||||
@@ -305,7 +305,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
$this->assertDatabaseHas('student_class', [
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Updated description',
|
||||
@@ -315,7 +315,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
1,
|
||||
StudentClass::query()
|
||||
->where('student_id', $this->studentOne->id)
|
||||
->where('class_section_id', $this->sectionA->id)
|
||||
->where('class_section_id', $this->sectionA->class_section_id)
|
||||
->where('semester', 'Fall')
|
||||
->where('school_year', '2025-2026')
|
||||
->count()
|
||||
@@ -360,7 +360,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -369,7 +369,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
StudentClass::query()->create([
|
||||
'student_id' => $this->studentOne->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'description' => 'Morning group',
|
||||
@@ -393,7 +393,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
{
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
@@ -402,7 +402,7 @@ class AssignmentApiControllerTest extends TestCase
|
||||
|
||||
TeacherClass::query()->create([
|
||||
'teacher_id' => $this->teacherMain->id,
|
||||
'class_section_id' => $this->sectionA->id,
|
||||
'class_section_id' => $this->sectionA->class_section_id,
|
||||
'position' => 'main',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
|
||||
Reference in New Issue
Block a user