Closed danielsetreus closed 2 years ago
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
I'm also looking for a way to test that a user was subscribed to a list. Is that possible?
I don't see any Newsletter::fake()
method available.
At the moment I have to ignore that call by adding this to phpunit.xml
:
<env name="MAILCHIMP_DRIVER" value="null"/>
@clementmas You can use the method 'shouldReceive' from the Facade.
Newsletter::shouldReceive('isSubscribed')
->with($subscriber->email)
->once()
->andReturn(false);
Newsletter::shouldReceive('subscribe')
->with($subscriber->email)
->once()
->andReturnNull();
Let's say I have a service that among other things does
How would I go about writing tests for that service? I can't find any obvious way of faking the facade, and it seems there are no methods for asserting the actions it does towards Mailchimp.