Level 70
Heads-up, I don't use Pest. But in php unit, this could be one of the approaches that I can think of based on your code.
May be it helps you for getting some idea and then tweak your test.
/** @test */
public function it_adds_teachers_and_students_to_team()
{
$team = factory(Team::class)->create();
$players = new Collection([
[
'teachers' => [1, 2],
'students' => [3, 4],
],
[
'teachers' => [5, 6],
'students' => [7, 8],
],
]);
$addTeachersToTeamActionSpy = $this->spy(AddTeachersToTeamAction::class);
$addStudentsToTeamActionSpy = $this->spy(AddStudentsToTeamAction::class);
$addPlayersToTeamAction = new AddPlayersToTeamAction();
$addPlayersToTeamAction->handle($team, $players);
$addTeachersToTeamActionSpy->shouldHaveBeenCalledTimes(4);
$addStudentsToTeamActionSpy->shouldHaveBeenCalledTimes(4);
}