Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Extract switch team logic into HasTeams trait #312

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

chefe
Copy link
Contributor

@chefe chefe commented Oct 6, 2020

This PR extract the logic for team switching into the HasTeams trait, which allows to switch the current team from code.

Example: Use the switchTeam method to change the current team during a test.

/** @test */
public function xyz()
{
    $user = User::factory()->create();

    // ...

    $user->switchTeam($otherTeam);

    // ...
}

@chefe chefe force-pushed the extract-switch-team-logic branch from 2ca111a to 953512c Compare October 6, 2020 12:13
@taylorotwell taylorotwell merged commit 21a4469 into laravel:1.x Oct 6, 2020
@chefe chefe deleted the extract-switch-team-logic branch October 6, 2020 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants