We have a fairly complete functional test suite using Selenium for testing all our WebControls. But PRADO lacks of a complete unit test suite so I've done some work on moving and improving the unit test suite in PRADO 3.1 (trunk), but we still have a long way to go. Therefor I'm looking for someone to help out and I'll be your mentor
Ok, so I probably should tell some more about what I do. I'm writing all the unit tests using
PHPUnit 3. The reason for using PHPUnit 3 over SimpleTest is the command line utility, various output formats, integration with other tools, test reports and code coverage reports.
Writing unit tests also gives you a unique insight in PRADO's inner workings. We have around ~200 unit tests implemented now and ~300 incomplete stubs (the number of uncovered unit tests is much higher).
So after installing PHPUnit 3 you go to tests/unit/ in your framework directory in trunk/ and execute AllTests.php which is a test suite that combine all the other tests.
/Sites/prado/svn/trunk/tests/unit knut$ phpunit AllTests.php
PHPUnit 3.0.6 by Sebastian Bergmann.
IIIIII..........III......................
.........................................
......................................III
IIIIIIIIII...............................
...IIIIIIIIIIIIIIIII....II............I..
.IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIII..IIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
II.........I....I.IIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIII.......I......
........II..............
Time: 00:06
OK, but incomplete or skipped tests!
Tests: 557, Incomplete: 342.
"I" means "Incomplete" and "." means "test passed". (other: "F" = "Failed" and "S" = "Skipped")
You can also easily create a code coverage report (depends on
Xdebug) by running:
phpunit --report=coverage AllTests.php
which will create a directory "coverage" inside tests/unit/ that you can open with your web browser (see:
http://www.urdalen.com/prado/qa/coverage/).
You can also run individual tests:
cd Collections; phpunit TListTest.php
or all tests inside a package:
cd Collections; php AllTests.php
The best way to start is taking some of the incomplete tests (marked with "throw new PHPUnit_Framework_IncompleteTestError()"), looking at the other files in the test suite and start testing each function.
So if you are interested in helping out, please give me a PM here on the forum.