### From the command line $ phpunit --bootstrap=index.php modules/unittest/tests.php Of course, you'll need to make sure the path to the tests.php file is correct. If you want you can copy it to a more accessible location ### From the web Just navigate to http://example.com/unittest. You may need to use http://example.com/index.php/unittest if you have not enabled url rewriting in your .htaccess. ## Writing tests If you're writing a test for your application, place it in "application/tests". Similarly, if you're writing a test for a module place it in modules/[modulefolder]/tests Rather than tell you how to write tests I'll point you in the direction of the [PHPUnit Manual](http://www.phpunit.de/manual/3.4/en/index.html). One thing you should bear in mind when writing tests is that testcases should extend Kohana_Unittest_Testcase rathr than PHPUnit_Framework_TestCase. Here's a taster of some of the cool things you can do with phpunit: ### Data Providers Sometimes you want to be able to run a specific test with different sets of data to try and test every eventuality Ordinarily you could use a foreach loop to iterate over an array of test data, however PHPUnit already can take care of this for us rather easily using "Data Providers". A data provider is a function that returns an array of arguments that can be passed to a test. assertSame( $length, strlen($string) ); } } The key thing to notice is the `@dataProvider` tag in the doccomment, this is what tells PHPUnit to use a data provider. The provider prefix is totally optional but it's a nice standard to identify providers. For more info see: * [Data Providers in PHPUnit 3.2](http://sebastian-bergmann.de/archives/702-Data-Providers-in-PHPUnit-3.2.html) * [Data Providers](http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers) ### Grouping tests To allow users to selectively run tests you need to organise your tests into groups. Here's an example test showing how to do this: