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

6.14 dispatchAfterResponse not working in tests #31416

Closed
Jigsaw5279 opened this issue Feb 10, 2020 · 0 comments
Closed

6.14 dispatchAfterResponse not working in tests #31416

Jigsaw5279 opened this issue Feb 10, 2020 · 0 comments

Comments

@Jigsaw5279
Copy link

  • Laravel Version: 6.14.0
  • PHP Version: 7.3.10
  • Database Driver & Version: Irrelevant

Description:

This issue is related to PR #31300, more specifically testing the feature.

I can't use the BusFake to assert that the job was actually dispatched.

Steps To Reproduce:

Given the following Controller Snippet:

public function store() {
  // ...
  DispatchableJob::dispatchAfterResponse();
  // ...
}

with the following test

    /** @test */
    public function dispatches_a_job() {
        $this->withoutExceptionHandling();
         \Bus::fake();

        $this->postJson(route('some.route'));;

        \Bus::assertDispatched(DispatchableJob::class);
    }

I get the following Exception:
Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Illuminate\Support\Testing\Fakes\BusFake::dispatchAfterResponse()

Maybe I'm doing things wrong, but I think the BusFake should support testing this feature?

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

No branches or pull requests

2 participants