atoum / atoum

The modern, simple and intuitive PHP unit testing framework.

Home Page:http://atoum.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO concept

ostrolucky opened this issue · comments

In PHP test frameworks world, none offer interesting feature from Perl world. This feature allows to mark test as expected to fail. More in a quote from TODO: BLOCK section of Test::More Perl module, which says

Declares a block of tests you expect to fail and $why. Perhaps it's because you haven't fixed a bug or haven't finished a new feature:


With a todo block, the tests inside are expected to fail. Test::More will run the tests normally, but print out special flags indicating they are "todo". Test::Harness will interpret failures as being ok. Should anything succeed, it will report it as an unexpected success. You then know the thing you had todo is done and can remove the TODO flag.

The nice part about todo tests, as opposed to simply commenting out a block of tests, is it's like having a programmatic todo list. You know how much work is left to be done, you're aware of what bugs there are, and you'll know immediately when they're fixed.

Once a todo test starts succeeding, simply move it outside the block. When the block is empty, delete it.

In PHPUnit there is markTestIncomplete, but it's meant to be used for tests which weren't finished yet, not really comparable.

Would be nice for atoum to take this as an opportunity to be a first PHP test framework with this concept.

thanks for submiting it. Not sure if it really usefull but we will speak about it for the v4.0.0