Posts

Mastering PHPUnit: Using data providers

Learn how to use data providers in PHPUnit, to test a lot of scenarios and reduce code duplication

May 22, 2024

Mastering PHPUnit: Writing Your First Test with PHPUnit

Learn how to write your first tests in PHPUnit, using assertions. Use methods like setUp and tearDown, to reduce code duplication

May 17, 2024

Mastering PHPUnit: an introduction

In this blog series we’ll go from writing our first unit test to being a PHPUnit master. This first post will go over the basics, and introduce you to PHPUnit

May 3, 2024

Never deploy an untagged dependency again

Today we ran into an issue with a build in one of our projects. Composer could no longer install, as a dependency was gone. When we opened our pipeline logs we saw the following error:

Apr 26, 2024

Stop (ab)using allow failure

We’ve all had our CI fail due to an issue that couldn’t be fixed right away. Usually something like a security issue in a downstream package that can’t be updated yet.

Jul 24, 2022

Creating better services

When writing code, you generally want to split up the logic in to different classes. You have your controller classes which take a request, and return a response. You write value objects to represent information which is important to your application.

Nov 13, 2021

Differential serving with webpack encore

Recently we’ve been looking into differential serving. With our set up there were a few complications, so in this post i’ll share how we overcame those, and how to set up differential serving with webpack encore.

Jun 19, 2021

PHP needs an "unknown" type

If you are familiar with Typescript, you may know their any type. With any you can do anything. It signals that you don’t know about the actual type, and that anything goes.

May 21, 2021

Using CSS modules in react when testing with enzyme

Use CSS modules classes as selectors for your tests, and have better snapshots.

Apr 24, 2021

Testing Exceptions in PHPUnit

Last week i gave 10 phpunit tips. This week we’ll take a look at testing exceptions, which wasn’t covered in that post. Lets start with some example code that we will be testing.

Apr 9, 2021