Behavior-driven development

When it was said that there is no real alternative to PHPUnit, it wasn't exactly true, or to be precise, there is no real alternative in the PHP world for unit testing. However, the reason might be that in recent years, many developers discovered that unit testing has its own challenges and problems. An answer for this came in terms of BDD, which is a different approach in writing tests and testing your code. There are a few projects available that take a different approach to testing, and you might realize that you are better suited to BDD than TDD.

Understanding BDD

To explain what BDD is, we should go back to TDD to examine any potential weaknesses there. As we have seen, you first write a test, and then write the ...

Get PHPUnit Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.