create(); $user->refresh(); $a = User::factory()->create(); $a->refresh(); $b = User::factory()->create(); $b->refresh(); foreach ([$a->profile_id, $b->profile_id] as $targetId) { $f = new Follower; $f->profile_id = $user->profile_id; $f->following_id = $targetId; $f->save(); } $ids = FollowerService::getFollowingIds($user->profile_id); expect($ids)->toContain($a->profile_id) ->toContain($b->profile_id) ->toContain($user->profile_id); }); it('returns only the callers own id when following nobody', function () { $user = User::factory()->create(); $user->refresh(); $ids = FollowerService::getFollowingIds($user->profile_id); expect($ids)->toBe([$user->profile_id]); });