Alan Langford 🇨🇦🧤🧊摏<p>A couple of years ago I wrote a <a href="https://mindly.social/tags/php" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>php</span></a> script that mucks around with some system files. Because I didn't want to break my system while testing the code, I wrote some relatively tedious tests in <a href="https://mindly.social/tags/phpunit" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>phpunit</span></a> with mock objects, validating the parameters that were passed down to the filesystem.</p><p>It was a real pain in the butt, but I got the thing debugged without making a mess of my working environment.</p><p>Today I decided to add a new feature, and there's no way to express how much time having all that stuff set up saved. I copied a similar test, adapted it to the new feature, got it to pass tests, and deployed it without issue.</p><p>Coding a good test suite pays back over, and over, and over again.</p>