'base64:'.base64_encode(random_bytes(32)), 'app.cipher' => 'AES-256-CBC', 'view.compiled' => $compiledPath, ]); } public function test_admin_calendar_view_lists_school_calendar_events_for_selected_year(): void { $this->seedAdminContext(); DB::table('calendar_events')->insert([ 'title' => 'Back to School Night', 'date' => '2025-09-14', 'description' => 'Families meet teachers.', 'notify_parent' => 1, 'notify_admin' => 1, 'notify_teacher' => 1, 'no_school' => 0, 'semester' => 'Fall', 'school_year' => '2025-2026', 'notification_sent' => 0, 'created_at' => now(), 'updated_at' => now(), ]); DB::table('calendar_events')->insert([ 'title' => 'Other Year Event', 'date' => '2026-09-13', 'description' => 'Should not render for the selected year.', 'notify_parent' => 1, 'notify_admin' => 1, 'notify_teacher' => 1, 'no_school' => 0, 'semester' => 'Fall', 'school_year' => '2026-2027', 'notification_sent' => 0, 'created_at' => now(), 'updated_at' => now(), ]); $response = $this->actingAs(User::query()->findOrFail(1)) ->get('/app/administrator/calendar_view?school_year=2025-2026'); $response->assertOk(); $response->assertSee('School Calendar'); $response->assertSee('Add School Calendar Entry'); $response->assertSee('Notify Parent'); $response->assertSee('No School'); $response->assertSee('Back to School Night'); $response->assertSee('Families meet teachers.'); $response->assertDontSee('Other Year Event'); } private function seedAdminContext(): void { DB::table('configuration')->insert([ ['config_key' => 'school_year', 'config_value' => '2025-2026'], ['config_key' => 'semester', 'config_value' => 'Fall'], ]); DB::table('roles')->insert([ 'id' => 1, 'name' => 'administrator', 'slug' => 'administrator', 'is_active' => 1, ]); DB::table('users')->insert([ 'id' => 1, 'school_id' => 1, 'firstname' => 'Admin', 'lastname' => 'User', 'gender' => 'Female', 'cellphone' => '5555555555', 'email' => 'admin-calendar@example.com', 'address_street' => '123 Main', 'city' => 'City', 'state' => 'ST', 'zip' => '12345', 'accept_school_policy' => 1, 'is_verified' => 1, 'status' => 'Active', 'is_suspended' => 0, 'failed_attempts' => 0, 'password' => bcrypt('secret'), 'semester' => 'Fall', 'school_year' => '2025-2026', 'created_at' => now(), 'updated_at' => now(), ]); DB::table('user_roles')->insert([ 'user_id' => 1, 'role_id' => 1, ]); } }