Blog

My Articles

Here I share my thoughts, ideas, and experiences.
I write about PHP & Laravel and other web development topics in general.

How to test TestJob::dispatchNow in Laravel?

Some time ago, I needed to write a test for Laravel job and I've spent hours searching for solution. Testing Laravel jobs that are queued is straightforward. But how do you test jobs that are...


Amazon SES and how to track Laravel Emails & Notifications

I've been working on a project where the requirement was to send emails via Amazon SES and track deliverability status with webhooks. Not surprisingly, at least for me, the ride wasn't a...


Contract Test

When testing 3rd party API call (dealing with external resources), one of the problems is that those tests are slow. One of the solutions is to use fake classes. On the outside, the fake class...


Tips on testing PHP exceptions

Let's have a shamefully simple class like this: Back in the days, there were three options for how to test the exception. From PHPunit 9.0 onwards, only two remain. expectedException annotation...

My Work Featured on Laravel News