Cleaning up Repetitious PHPUnit / Symfony test assertions

Coming from Rails, I know that DRY (don’t repeat yourself) is a virtue. In my Symfony PHP project, I was faced with copy-pasting a hundred lines in order to test a bunch of methods in PHPUnit. So, I wrote a quick wrapper to take in the arguments as minimally as possible instead of cluttering up the code with tons of duplicate syntax: https://gist.github.com/zyphlar/c959b2d66bce1c10c637

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s