I'm starting a TDD project using PHPUnit and something really bugs me.
It seem that all test can't be run as long as all classes and methods will not be implemented. How can I do to make the test continue event if a class or a method is not yet implemented ?
Thanks.
Edit: "Isn't the point of TDD that your testsuite fails while writing tests?" Yes, of course, but I want to have a global sight of the project. Let say we've written 1000 test, and the first one that is run makes a fatal error. But not lucky we are, when we come to implement the code, that part will be one of the last to be implemented. I don't want to develop "blind" and only been able to run my test suites when all fatal error will be cleared.
So yes, their's a huge difference between a test that fail, and the whole testing process to halt/die because of a fatal error that is normal at this state.
As a work-arround, we created our class skeleton before beginning to write our tests.
Isn't the point of TDD that your testsuite fails while writing tests?
I guess your point is that it dies with a fatal error instead of just display the red "i failed" bar. Quite an interesting point, I'm doing TDD with phpunit but that never has bugged me at all.
The first thing that came do mind was
--process-isolation
.Example:
Let's assume a test class that looks like this:
using the normal runner
phpunit test.php
:but when using the
phpunit --process-isolation test.php
switch it looks like this:And now the second test gets executed and passes