Welcome to the Cookbook

loading...

4.7.1.2 Running Core test cases

The release packages of CakePHP 1.2 do not ship with the core test cases. In order to get these tests, you need to download from the repository. All versions of CakePHP are currently located at the website http://code.cakephp.org/. You will need to create a user account with personal key, and use Git to access the repository.

To add the core tests to your existing application, uncompress the downloaded nightly package into a temporary directory. Locate the /cake/tests directory from the repository and copy it (recursively) into your /cake/tests folder.

The tests can then be accessed by browsing to http://your.cake.domain/test.php - depending on how your specific setup looks. Try executing one of the core test groups by clicking on the corresponding link. Executing a test group might take a while, but you should eventually see something like "2/2 test cases complete: 49 passes, 0 fails and 0 exceptions.".

Congratulations, you are now ready to start writing tests!

If you run all of the core tests at once or run core test groups most of them will fail. This is known by the CakePHP developers and is normal so don't panic. Instead, try running each of the core test cases individually.