4.7.1 Preparing for testing
There is no translation yet for this section. Please help out and translate this.. More information about translations
Ready to start testing? Good! Lets get going then!
4.7.1.1 Installing SimpleTest
There is no translation yet for this section. Please help out and translate this.. More information about translations
The testing framework provided with CakePHP 1.2 is built upon the SimpleTest testing framework. SimpleTest is not shipped with the default CakePHP installation, so we need to download it first. You can find it here: http://simpletest.sourceforge.net/.
Fetch the latest version, and unzip the code to your vendors folder, or your app/vendors folder, depending on your preference. You should now have a vendors/simpletest directory with all SimpleTest files and folders inside. Remember to have a DEBUG level of at least 1 in your app/config/core.php file before running any tests!
If you have no test database connection defined in your app/config/database.php, test tables will be created with a test_suite_ prefix. You can create a $test database connection to contain any test tables like the one below:
var $test = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'dbhost', 'login' => 'dblogin', 'password' => 'dbpassword', 'database' => 'databaseName' );
var $test = array('driver' => 'mysql','persistent' => false,'host' => 'dbhost','login' => 'dblogin','password' => 'dbpassword','database' => 'databaseName');
If the test database is available and CakePHP can connect to it, all tables will be created in this database.
4.7.1.2 Spouštění vestavěných test cases
The original text for this section has changed since it was translated. Please help resolve this difference. You can:
CakePHP 1.2 obsahuje sadu testů ověřujících funkcionalitu jádra CakePHP . Tyto testy jsou přístupné přes URL http://your.cake.domain/test.php (závisí na Vašem nastavení aplikace). Zkuste spustit jeden ze skupiny testů jádra (kliknutím na link). Spustění testovací skupiny může chvíli trvat, ale nakonec uvidite něco podobného: "2/2 test cases complete: 49 passes, 0 fails and 0 exceptions.". Gratulujeme, nyní jste připraven psát vlastní testy!


























