<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>&quot;phpunit&quot; entries | Aaron Saray</title><description>Blog entries by Aaron Saray that have the tag &quot;phpunit&quot;.</description><link>https://aaronsaray.com/tag/phpunit/</link><language>en-us</language><copyright>This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</copyright><lastBuildDate>Mon, 14 Sep 2026 00:00:00 GMT</lastBuildDate><atom:link href="https://aaronsaray.com/tag/phpunit/index.xml" rel="self" type="application/rss+xml"/><item><title>Why I&apos;m Starting to Love Parallel Testing</title><link>https://aaronsaray.com/2026/why-i-am-starting-to-love-parallel-testing/</link><guid isPermaLink="true">https://aaronsaray.com/2026/why-i-am-starting-to-love-parallel-testing/</guid><description>&lt;p&gt;Maybe I’m behind. But I like to think of it as conservative.  Parallel unit testing has been around for a while,
and I haven’t really reached for it until recently.&lt;/p&gt;
&lt;p&gt;This isn’t about not wanting to change, though.  It’s about using the proper tools for the job, and only when necessary.&lt;/p&gt;
&lt;p&gt;Or at least, that’s how I rationalize my delay. But maybe you’re in the same place.  Let’s dig into why I waited,
why you might want to wait still, and the reasons why this works now.&lt;/p&gt;</description><pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate></item><item><title>The Importance of ToDo Tests</title><link>https://aaronsaray.com/2021/phpunit-todo-tests/</link><guid isPermaLink="true">https://aaronsaray.com/2021/phpunit-todo-tests/</guid><description>&lt;p&gt;I’m not a huge fan of &lt;code&gt;todo&lt;/code&gt; comments in code because I think they’re mainly forgotten. However, I don’t have the same opinion for PHPUnit tests.  Let’s talk about why - and how to easily add them in your code.&lt;/p&gt;</description><pubDate>Mon, 22 Mar 2021 00:00:00 GMT</pubDate></item><item><title>Do Not Calculate Answers to Your Unit Tests</title><link>https://aaronsaray.com/2021/do-not-calculate-answers-to-tests/</link><guid isPermaLink="true">https://aaronsaray.com/2021/do-not-calculate-answers-to-tests/</guid><description>&lt;p&gt;Since you’re a programmer, you’re always looking for ways to be a bit more efficient. Because of this, it can be easy to fall into the trap of being too programatic, too calculation-heavy in your unit tests. But, this isn’t a test then - its just another block of quite fallible code.  Let’s talk about why and show what to do instead.&lt;/p&gt;</description><pubDate>Mon, 08 Feb 2021 00:00:00 GMT</pubDate></item><item><title>Finding Slow Tests in PHPUnit 9</title><link>https://aaronsaray.com/2021/finding-slow-tests-in-phpunit-9/</link><guid isPermaLink="true">https://aaronsaray.com/2021/finding-slow-tests-in-phpunit-9/</guid><description>&lt;p&gt;When your unit test suite gets larger, it can take quite a long time. One of the many ways to speed this up is to hunt down and fix slow tests.  Let’s use PHPUnit’s test listeners to do just that.&lt;/p&gt;</description><pubDate>Mon, 04 Jan 2021 00:00:00 GMT</pubDate></item><item><title>PHPUnit Code Coverage Can Help While Writing Tests</title><link>https://aaronsaray.com/2020/phpunit-coverage-helps-while-writing-tests/</link><guid isPermaLink="true">https://aaronsaray.com/2020/phpunit-coverage-helps-while-writing-tests/</guid><description>&lt;p&gt;It’s great to run code coverage at the very end before you push your changes. This gives you some idea what’s tested and what’s not. But you don’t have to wait till the end; code coverage can help you all throughout writing your test suite, too.&lt;/p&gt;</description><pubDate>Mon, 28 Dec 2020 00:00:00 GMT</pubDate></item><item><title>Stop Using Assert Database Has in Laravel</title><link>https://aaronsaray.com/2020/stop-assert-database-has-laravel/</link><guid isPermaLink="true">https://aaronsaray.com/2020/stop-assert-database-has-laravel/</guid><description>&lt;p&gt;Please stop using &lt;code&gt;assertDatabaseHas&lt;/code&gt; in Laravel.  There are many reasons why this is bad, and there are better options available.  Let’s find out why.&lt;/p&gt;</description><pubDate>Fri, 24 Apr 2020 00:00:00 GMT</pubDate></item><item><title>Test Coverage is Not as Good of a Metric as You Think</title><link>https://aaronsaray.com/2019/test-coverage-bad-metric/</link><guid isPermaLink="true">https://aaronsaray.com/2019/test-coverage-bad-metric/</guid><description>&lt;p&gt;There are a lot of debates about trying to achieve test coverage of 100%. Some people swear you need to do this. Others say, get 80% or more… the rest doesn’t matter.  Each side has strong arguments.&lt;/p&gt;</description><pubDate>Sun, 09 Jun 2019 00:00:00 GMT</pubDate></item><item><title>Two Gotchas in Laravel Unit Testing</title><link>https://aaronsaray.com/2019/two-gotchas-in-laravel-unit-tests/</link><guid isPermaLink="true">https://aaronsaray.com/2019/two-gotchas-in-laravel-unit-tests/</guid><description>&lt;p&gt;There’s a struggle to balance the easy-to-use Laravel helpers and functions with very verbose, complicated methods in unit tests.  As I’ve been relying on Laravel’s way of doing testing more, I’ve ran into a couple of gotchas that I should share.&lt;/p&gt;</description><pubDate>Mon, 20 May 2019 00:00:00 GMT</pubDate></item><item><title>PHPUnit Runs Data Provider Before Setup</title><link>https://aaronsaray.com/2018/phpunit-dataprovider-before-setup/</link><guid isPermaLink="true">https://aaronsaray.com/2018/phpunit-dataprovider-before-setup/</guid><description>&lt;p&gt;I started noticing a disturbing trend on one of my projects: developers were doing too much logic in the &lt;code&gt;setup&lt;/code&gt; and data provider methods of their PHPUnit tests. However, before we could address this, a “limitation” popped up which helped them kick this habit.&lt;/p&gt;</description><pubDate>Mon, 03 Dec 2018 00:00:00 GMT</pubDate></item><item><title>PHPUnit Listener for Long Running Tests Update</title><link>https://aaronsaray.com/2017/phpunit-listener-for-long-running-tests-update/</link><guid isPermaLink="true">https://aaronsaray.com/2017/phpunit-listener-for-long-running-tests-update/</guid><description>&lt;p&gt;I wrote instructions in 2011 to &lt;a href=&quot;/2011/add-phpunit-listeners-to-watch-for-long-running-tests/&quot;&gt;add a PHPUnit Listener to Watch for Long Running Tests&lt;/a&gt; which seem to be a bit out of date now.  But, here’s a quick refresher:&lt;/p&gt;</description><pubDate>Wed, 15 Nov 2017 00:00:00 GMT</pubDate></item></channel></rss>