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

Allow faking only specific events #19429

Merged
merged 6 commits into from
Jun 1, 2017
Merged

Allow faking only specific events #19429

merged 6 commits into from
Jun 1, 2017

Conversation

adamwathan
Copy link
Contributor

@adamwathan adamwathan commented Jun 1, 2017

Sometimes you want most framework events to run, but just want to fake a handful that you want to make assertions about in a particular test.

This lets you do this sort of thing:

public function testSomething()
{
    Event::fake([ShouldBeFaked::class]);

    $response = $this->get('/');

    Event::assertDispatched(ShouldBeFaked::class);
}

Seems fine ¯\(ツ)

@marcusmoore
Copy link
Contributor

I was just thinking about this yesterday. Glad to see a PR!

@taylorotwell taylorotwell merged commit fd39889 into laravel:master Jun 1, 2017
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.

3 participants