dashboardForUser(null); $this->assertSame('guest', $payload['role']); } public function test_dashboard_for_user_returns_admin(): void { $roleId = DB::table('roles')->insertGetId([ 'name' => 'admin', 'priority' => 1, 'is_active' => 1, ]); $user = User::query()->create([ 'firstname' => 'Admin', 'lastname' => 'User', 'email' => 'admin@example.com', 'cellphone' => '5555555555', 'address_street' => '123 Main', 'city' => 'City', 'state' => 'ST', 'zip' => '12345', 'accept_school_policy' => 1, 'status' => 'Active', 'password' => bcrypt('secret'), 'semester' => 'Fall', 'school_year' => '2025-2026', ]); DB::table('user_roles')->insert([ 'user_id' => $user->id, 'role_id' => $roleId, ]); $service = app(LandingPageService::class); $payload = $service->dashboardForUser($user); $this->assertSame('admin', $payload['role']); } }