= CiviCRM HowTo Run Tests Tags: [[CiviCRM]] [[HowTo]] Summary and expansion of the procedure outlined in the CiviCRM page [[http://wiki.civicrm.org/confluence/display/CRM/Setting+up+your+personal+testing+sandbox+HOWTO|Settings up your personal testing sandbox]]. == Gitify a project The tests and test tools are not in the release package of CiviCRM, so you have to ''gitify'' the code - that is, convert it into a git repository and get the latest version of the code from Git Hub. I have had a couple of problems with this: 1. The {{{gitify}}} script gives you no options but to use the Master branch. 1. The {{{gitify}}} script gives you an example that does not work. 1. Still, some of the tests fail. Nevertheless, the procedure to do this is: 1. {{{sudo apt-get install git}}} (if it is not already installed) 1. {{{wget https://github.com/civicrm/civicrm-core/raw/master/bin/gitify}}} 1. {{{bash gitify git://github.com/civicrm --hooks}}}. e.g. {{{bash gitify git://github.com/civicrm /var/www/sites/all/modules/civicrm/ --hooks}}} == Set up test database 1. Create DB {{{civicrm_tests_dev}}} 1. Create the test user with SUPER privileges. 1. cd /path-to/civicrm 1. mysql -u user -p -hhostname civicrm_tests_dev < sql/civicrm.mysql 1. mysql -u user -p -hhostname civicrm_tests_dev < sql/civicrm_generated.mysql 1. In the file {{{/tests/phpunit/CiviTest/civicrm.settings.local.php}}} add the line {{{define('CIVICRM_DSN', 'mysql://db_username:db_password@localhost/civicrm_tests_dev');}}} [[BackLinks]]