Unit Testing

Hosted continuous integration services for PHP

Today, I’ve been evaluating popular hosted CI services to see how well they’re working with PHP and how much they cost. drone.io https://drone.io/ drone.io is free for Open Source projects (one concurrent build). Paid plans for private repositories start at 25 $ / month. Builds are configured on the Web site. PHP support is marked…
Read more

Why less mocking can improve everyone’s testing experience

There’s some confusion in the community concerning the use of mocks for unit testing. Mocking is creating objects that simulate the behaviour of real objects. I personally don’t mock class dependencies by default but use real objects and test doubles via dependency injection. Despite the success of this approach, many developers are still plagued by concerns that the…
Read more

Dependent Symfony 2 Bundles and Testability

I just stumbled upon a question concerning Symfony 2 bundles and testability that I want to share with you. When developing with Symfony, beginners tend to use lots of existing bundles, because this seems to be the recommend way of building an application. Later, they wonder, why it’s so hard to write unit and component tests or they write functional…
Read more

Using SQL fixtures for database related unit tests

This is a short tutorial to show how to use fixtures for database related unit tests. The inspiration for this post came from a conversation I had at the recent PHP Unconference in Hamburg, Germany. From my experience, the usual way to test database related classes is to use a special test database, that needs…
Read more