security fix and fix parent pages
API CI/CD / Validate (composer + pint) (push) Successful in 3m7s
API CI/CD / Test (PHPUnit) (push) Failing after 5m46s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m7s
API CI/CD / Test (PHPUnit) (push) Failing after 5m46s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -32,15 +32,28 @@ class ParentControllerTest extends TestCase
|
||||
]);
|
||||
|
||||
DB::table('attendance_data')->insert([
|
||||
'class_id' => 1,
|
||||
'class_section_id' => 1,
|
||||
'student_id' => $studentId,
|
||||
'school_id' => '1',
|
||||
'date' => '2025-10-01',
|
||||
'status' => 'absent',
|
||||
'reason' => 'Sick',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
[
|
||||
'class_id' => 1,
|
||||
'class_section_id' => 1,
|
||||
'student_id' => $studentId,
|
||||
'school_id' => '1',
|
||||
'date' => '2025-10-02',
|
||||
'status' => 'present',
|
||||
'reason' => null,
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
],
|
||||
[
|
||||
'class_id' => 1,
|
||||
'class_section_id' => 1,
|
||||
'student_id' => $studentId,
|
||||
'school_id' => '1',
|
||||
'date' => '2025-10-01',
|
||||
'status' => 'absent',
|
||||
'reason' => 'Sick',
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
],
|
||||
]);
|
||||
|
||||
Sanctum::actingAs($parent);
|
||||
@@ -48,6 +61,7 @@ class ParentControllerTest extends TestCase
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJson(['ok' => true]);
|
||||
$this->assertCount(1, $response->json('attendance'));
|
||||
$response->assertJsonPath('attendance.0.status', 'absent');
|
||||
}
|
||||
|
||||
@@ -91,6 +105,14 @@ class ParentControllerTest extends TestCase
|
||||
|
||||
private function seedParent(): User
|
||||
{
|
||||
$roleId = DB::table('roles')->insertGetId([
|
||||
'name' => 'parent',
|
||||
'slug' => 'parent',
|
||||
'is_active' => 1,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$id = DB::table('users')->insertGetId([
|
||||
'firstname' => 'Parent',
|
||||
'lastname' => 'User',
|
||||
@@ -106,6 +128,15 @@ class ParentControllerTest extends TestCase
|
||||
'semester' => 'Fall',
|
||||
'school_year' => '2025-2026',
|
||||
'status' => 'Active',
|
||||
'is_verified' => 1,
|
||||
'is_suspended' => 0,
|
||||
]);
|
||||
|
||||
DB::table('user_roles')->insert([
|
||||
'user_id' => $id,
|
||||
'role_id' => $roleId,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
return User::query()->findOrFail($id);
|
||||
|
||||
Reference in New Issue
Block a user