芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/vendor/laravel/jetstream/stubs/tests/livewire/InviteTeamMemberTest.php
actingAs($user = User::factory()->withPersonalTeam()->create()); $component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) ->set('addTeamMemberForm', [ 'email' => 'test@example.com', 'role' => 'admin', ])->call('addTeamMember'); Mail::assertSent(TeamInvitation::class); $this->assertCount(1, $user->currentTeam->fresh()->teamInvitations); } public function test_team_member_invitations_can_be_cancelled() { $this->actingAs($user = User::factory()->withPersonalTeam()->create()); // Add the team member... $component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) ->set('addTeamMemberForm', [ 'email' => 'test@example.com', 'role' => 'admin', ])->call('addTeamMember'); $invitationId = $user->currentTeam->fresh()->teamInvitations->first()->id; // Cancel the team invitation... $component->call('cancelTeamInvitation', $invitationId); $this->assertCount(0, $user->currentTeam->fresh()->teamInvitations); } }