------------------------------------------------------------ revno: 999 committer: Jon Phillips <[email protected]> branch nick: public timestamp: Fri 2012-01-06 18:30:01 +0800 message: added text to phpunit and made sure it works. Its important to keep these together. We could include web-based php unit tests later if we wanted modified: tests/README tests/bootstrap.php
-- lp:aikiframework https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk Your team Aiki Framework Developers is subscribed to branch lp:aikiframework. To unsubscribe from this branch go to https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'tests/README' --- tests/README 2012-01-06 10:11:31 +0000 +++ tests/README 2012-01-06 10:30:01 +0000 @@ -1,2 +1,41 @@ +Aiki Framework + PHP Unit +========================= + This is the salvaged phpunit tester which is not directly hooked into aiki framework. + +This folder is included with aiki to encourage people to write unit tests +for their code. + + +WHY? +==== + +Writing unit tests are a great way for programmers to test their code when +working on all sizes of projects to insure that it is working well, is +encapsulated, and stays solid through other peoples changes over time. + + +Installing PHPUNIT +================== + +* get it from the php pear program to install the latest stable phpunit + +OR + +* clone the repo from https://github.com/sebastianbergmann/phpunit + + +Writing Unit Test +================= + +To write a unit test, see libs/LogTest.php for a quick example of testing +code in Aiki Framework. + +Then you can run phpunit like so: + + phpunit LogTest + +If there are errors, then fix them! + + === modified file 'tests/bootstrap.php' --- tests/bootstrap.php 2012-01-06 10:11:31 +0000 +++ tests/bootstrap.php 2012-01-06 10:30:01 +0000 @@ -2,9 +2,12 @@ /** Prepend to the include path for all unit tests. * Tests should always prefer the configured and built - * src before the distributed source. */ + * src before the distributed source. + * + * Add like the following if need in other folders: + * + * __DIR__ . "/../build/src" . PATH_SEPARATOR . + */ set_include_path( - __DIR__ . "/../build/src" . PATH_SEPARATOR . - __DIR__ . "/../src" . PATH_SEPARATOR . get_include_path() -); \ No newline at end of file +);
_______________________________________________ Mailing list: https://launchpad.net/~aikiframework-devel Post to : [email protected] Unsubscribe : https://launchpad.net/~aikiframework-devel More help : https://help.launchpad.net/ListHelp

