Welcome to the Cookbook

loading...

4.7.12 Lancer les tests depuis la ligne de commande

Le texte original de cette section a changé depuis qu'il a été traduit. Aidez-nous à corriger cette différence. Vous pouvez :

Plus d'information à propos des traductions

Si vous avez installé simpletest, vous pouvez lancer vos tests depuis la ligne de commande de votre application.

Depuis app/, exécutez :
cake testsuite help

Usage: 
	cake testsuite category test_type file
		- category - "app", "core" or name of a plugin
		- test_type - "case", "group" or "all"
		- test_file - file name with folder prefix and without the (test|group).php suffix

Examples: 
		cake testsuite app all
		cake testsuite core all

		cake testsuite app case behaviors/debuggable
		cake testsuite app case models/my_model
		cake testsuite app case controllers/my_controller

		cake testsuite core case file
		cake testsuite core case router
		cake testsuite core case set

		cake testsuite app group mygroup
		cake testsuite core group acl
		cake testsuite core group socket

		cake testsuite bugs case models/bug
		  // for the plugin 'bugs' and its test case 'models/bug'
		cake testsuite bugs group bug
		  // for the plugin bugs and its test group 'bug'

Code Coverage Analysis: 


Append 'cov' to any of the above in order to enable code coverage analysis

Comme le suggère le menu help, vous serez en mesure de lancer tous vos tests, une partie ou un seul cas de test depuis votre app, votre plugin ou le cœur, simplement depuis la ligne de commande.

Si vous avez un modèle de test dans test/models/mon_modele.test.php, vous lancerez simplement ce cas de test en exécutant :

cake testsuite app models/mon_modele