assertEquals($expectedMessage, $e->getMessage()); } public function provideMessages(): iterable { yield 'without domain' => [ 'No URL found with short code "abc123"', 'abc123', null, ]; yield 'with domain' => [ 'No URL found with short code "bar" for domain "foo"', 'bar', 'foo', ]; } }