Tricorder: a testing helper for PHP
I’ve hacked together a little CLI script that I think will be of use to many people who are trying to answer the question “just what should I do to test this thing anyway?” as they learn how to write...
View ArticleDIC vs. Service Locator
People often ask me what’s the one thing they could do for their code base RIGHT NOW that will make it easier to test. To me, the answer is simple: make sure you are using Dependency Injection (yes the...
View ArticleMonkey-patching is for closers
My co-worker Juan Treminio brought to my attention this interesting blog post by someone advocating monkey-patching strtotime in order to test his code.
View ArticlePHPSpec and the new wave of testing
I promised @everzet almost two weeks ago that I would take a look at his latest project, phpspec, and let him know what I think.
View ArticleThe birth of Grumpy Learning
It’s no secret that I have been pushing my “grumpy programmer” brand hard. Why not? It’s delivering a non-trivial amount of side income for me and I have been really enjoying it.
View ArticleSo you want to write tests
I often get asked for some advice on how to get started with writing tests for your PHP code. It’s a fair question, since I am presenting myself as an expert-ninja-rockstar-sensei-opinionated-egomaniac...
View ArticleYou need tests...just not yet
Every once in a while I come across a blog post or a presentation that helps me figure out something that has been bothering but I was having problems articulating. Lately I’ve been struggling to come...
View ArticleStandards, soapboxes, and shamans
Programmers often look to external sources for validation of all sorts of things they do. Did they choose the right language? Are they writing good code? Will they be accepted by their peers.
View ArticleTesting Smells - try/catch
As part of a project to migrate the PHP code at work from PHP 5.2 to PHP 5.4, I’m using our extensive test suite to look for instances where something that changed between the versions of PHP that we...
View ArticleTesting Listener
I had an idea to put together some kind of “PHP Testing Koans” site as a way to help PHP developers get better at learning how to actually write tests. Most developers who are introduced to testing get...
View ArticleData providers and arrays in PHPUnit
I was asked a question on Twitter by Tex Morgan about a problem he was having with PHPUnit data providers. He was trying to pass in some data and kept wondering why PHPUnit was serializing the data...
View ArticleThe Power of the BrowserProxyMob
At work I have been involved with an effort to put some automated front-end testing in place. The combination of Behat, Mink running tests using PhantomJS is a good one for this. Open source, easy to...
View ArticleTest Spies and Mockery
While recording some screencasts I was struggling to figure out how to get PHPUnit’s built-in object mocking tools to allow me to create what is known as a “test spy”. I talk about them briefly in my...
View Article