insert([ 'id' => 1, 'class_section_id' => 1, 'class_section_name' => '1A', 'class_id' => 1, 'semester' => 'Fall', 'school_year' => '2025-2026', ]); $service = new GradingLockService; $locked = $service->toggle(1, 'Fall', '2025-2026', 99); $this->assertTrue($locked); $this->assertDatabaseHas('grading_locks', [ 'class_section_id' => 1, 'semester' => 'Fall', 'school_year' => '2025-2026', 'is_locked' => 1, ]); } public function test_lock_all_locks_sections(): void { DB::table('classSection')->insert([ [ 'id' => 1, 'class_section_id' => 1, 'class_section_name' => '1A', 'class_id' => 1, 'semester' => 'Fall', 'school_year' => '2025-2026', ], [ 'id' => 2, 'class_section_id' => 2, 'class_section_name' => '1B', 'class_id' => 1, 'semester' => 'Fall', 'school_year' => '2025-2026', ], ]); $service = new GradingLockService; $count = $service->lockAll('Fall', '2025-2026', 99); $this->assertSame(2, $count); $this->assertDatabaseHas('grading_locks', [ 'class_section_id' => 2, 'semester' => 'Fall', 'school_year' => '2025-2026', 'is_locked' => 1, ]); } }