No release, weekly updates, and weekly tip

No release

No release as Taylor is traveling this week.

Weekly Journal

Last week I continued reviewing the tasks for the Shift Workbench. I also sunset the Shift CLI. If you have it installed, you may continue to use it. But it will no longer receive active development.

I also continued to make some patches to Shift based on recent support emails. Again, nothing major. Normally just tolerating rather extreme edge-cases from unexpected code. As always, I try to move the needle ever so slightly towards 100% automation.

With any extra time, I continued working on my Laravel additions package. I went ahead and tagged a pre-release so I could start using it in my own projects. I actually added another "addition" in today's livestream. So one more and I'll tag a v1.0.0. But despite the v0.x tags, the current additions are ready to use.

Weekly Tip

Joel Clermont brought this up in a recent tweet, then I experienced it again over the weekend. So I took a minute to write a macro for my additional test assertions package.

To summarize, you can't assert view data is actually null. Even explicitly passing null to assertViewHas only asserts the key exists in the view data. Not that it is actually set to null.

The way around this is to pass a closure which verifies the value is null:

1$this->assertViewHas('coupon', fn ($value) => is_null($value));

However, that's a bit dense. In addition, when the tests fails, it states: failed asserting false is true. Which is not as helpful as, stating something like: coupon was not null.

So, I added a assertViewHasNull assertion which both streamlines the null check and provides a clearer failure message. Now, using v2.7 of my package, I can assert:

1$this->assertViewHasNull('coupon');

This also resulted in a deep-dive to document macros.

View Archives →