Have you ever struggled to write expressive, easy-to-read test assertions in PHP? Ever written tests where you have to write way more lines than the actual code you’re testing? If so, then Hamcrest PHP could be the answer.

In this talk, I’ll show you how to use Hamcrest to make your tests read more like English sentences, and how to leverage the power of custom matchers to make sure that you’re truly asserting against what you want to.


Comments are closed.

Liam Wiltshire at 12:02 on 9 Jun 2017

A good talk - I've been a PHPUnit user forever, but certainly going to check out Hamcrest now. One point - some of the slide colours were not readable, but content wise very good!

Great talk with lots of clear explanations and code examples. Covered all areas; I had a question in mind near the beginning of the talk only to find that you had answered it further on! Hadn't heard of Hamcrest before but will definitely be looking into using it after this. Thanks!

Koen Eelen at 23:52 on 9 Jun 2017

Really good introduction to a really interesting tool.
Will check it out!

Chris Sherry at 10:44 on 10 Jun 2017

Hamcrest looks like a great tool and a solution to some issues I have been having.

I was sold on it within the first 5 minutes, and it was nice to see some of the things it can do.

The talk was let down unfortunately by the slidedeck.
The size of the text was far too small, and the colours didn't help either (although I think the layout was well though out).
I recommend checking out Kat Zien 's slides from this conference as a good example.

Sean Wallis at 12:36 on 10 Jun 2017

Gareth spoke very clearly and gave very useful explanations and examples. Unfortunately, some of the slides were not readable, although Gareth talked around it well.

Really like the readability of the codes produced using Hamcrest and hope I have time to get into this.

Naomi Gotts at 19:28 on 12 Jun 2017

Good content and style although shame about the slide contrast etc. I'm a PhpSpec user and hadn't heard of Hamcrest. Not sure if the matchers can be used with PhpSpec; something to find out I guess!

We definitely need more attention to readability and optimization for debugging, tests are useful when they fail. To be complete needs to go into matchers vs. custom assertions as in http://xunitpatterns.com/Custom%20Assertion.html and where there are advantages to use one or the other.

Interesting talk, but some of the text was hard to read and actual slides could use some work regarding colours.