zenstruck / messenger-test

Assertions and helpers for testing your symfony/messenger queues.
MIT License
223 stars 15 forks source link

Ability to change transport options before booting kernel #1

Closed kbond closed 3 years ago

kbond commented 3 years ago

Currently, you have to boot the kernel before changing the transport options.

public function test_foo(): void
{
    self::bootKernel();

    $this->transport()->intercept();
    $this->transport()->catchExceptions();
}

It would be nice if you could do:

public function test_foo(): void
{
    $this->transport()->intercept();
    $this->transport()->catchExceptions();

    self::bootKernel();

    // ...
}

This would be useful when using a tool like browser that boots the kernel automatically (it makes changing these options awkward).