zenstruck / messenger-test

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

Add `EnvelopeCollection::back()` #28

Closed kbond closed 3 years ago

kbond commented 3 years ago

Allows making assertions on multiple collections in a fluid way:

$this->messenger()
    ->queue()
        ->assertNotEmpty()
        ->assertContains(MyMessage::class)
    ->back() // returns to the TestTransport
    ->dispatched()
        ->assertEmpty()
    ->back()
    ->acknowledged()
        ->assertEmpty()
    ->back()
    ->rejected()
        ->assertEmpty()
    ->back()
;