It’s been a month since I’ve started using Linux Mint on a daily basis for work-related stuff. I want to get more familiarized with it as a consumer OS and not interact with it only via a console for our VPS instances.

Last week we ran into an issue with one of our repositories.

The problem was caused by the PHPUnit tests that were written on Windows. In some of those specific tests, we needed to check the existence of a file in a specific place, or look for a certain line inside that file.

The path used to get to that file was written for Windows.

When I tried to run the tests, they failed badly and I got F after F.

The solution was pretty simple, we ended up updating all those paths using the DIRECTORY_SEPARATOR constant that PHP offers. This makes the path OS-agnostic and fixes all those issues.

The initial code that looked like this:

$seederFilesFolderPath = $this->seederFilesFolderPath('\images\default-covers');

Turned into this:

$seederFilesFolderPath = $this->seederFilesFolderPath(DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'default-covers');

This issue probably would’ve been caught earlier if we’d run the tests in the pipeline, but we run the tests on our machines before deploying versions. And yes, those were Windows, until now.