Source: travis-weston.medium.com

Using Custom Fakers in Laravel Feature Tests
I’m not going to lie. Not that it was very difficult, but because it just isn’t well documented — which is odd for anything in Laravel, frankly.

The way this is han dled currently is to take a CSV of all print subscribers, and manually add those to the digital subscription system once a month.

Easy enough, I thought, I’ll just write up a really simple Faker that will create a CSV file in that format, upload it to a fake disk that my system will access, and then I can run some assertions based on the contents of that CSV.

If this article was interesting to you, you’re going to love the stream of tech-consciousness that is my Twitter feed.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners