insertGetId([ 'firstname' => 'Admin', 'lastname' => 'User', 'cellphone' => '9999999999', 'email' => 'assign@example.com', 'address_street' => '123 Street', 'city' => 'City', 'state' => 'ST', 'zip' => '12345', 'accept_school_policy' => 1, 'password' => bcrypt('password'), 'user_type' => 'primary', 'semester' => 'Fall', 'school_year' => '2025-2026', 'status' => 'Active', ]); $roleId = DB::table('roles')->insertGetId([ 'name' => 'admin', 'slug' => 'admin', 'description' => 'Admin', 'dashboard_route' => 'administrator/administratordashboard', 'priority' => 1, 'is_active' => 1, 'created_at' => now(), 'updated_at' => now(), ]); $service = new RoleAssignmentService(new RoleStaffService()); $result = $service->assignRoles($userId, [$roleId], $userId); $this->assertTrue($result['ok']); $this->assertDatabaseHas('user_roles', [ 'user_id' => $userId, 'role_id' => $roleId, ]); $this->assertDatabaseHas('staff', [ 'user_id' => $userId, ]); } }