You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a fragment of a package that I'm working on, the "problem" that I have is that this code is failing, and this is the message:
Failed asserting that 'This is a custom exception' [ASCII](length: 26) contains "Asciito\SimpleGenerators\Clients\Contracts\Exceptions\ClientException" [ASCII](length: 69).
So, I want to know if toThrow also works with interfaces, but for want I read in the source code, this should be possible.
$client = TextGenerator::fakeClient([
ClientFakeException::make('fake', 'This is a custom exception'),
]);
$generator = TextGenerator::make('throwable', $client);
expect(fn() => $generator->prompt('This is just a fake prompt'))
->toThrow(
ClientException::class,
'This is a custom exception',
);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a fragment of a package that I'm working on, the "problem" that I have is that this code is failing, and this is the message:
So, I want to know if
toThrow
also works with interfaces, but for want I read in the source code, this should be possible.is there something that I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions