Actions

Difference between revisions of "Developer Area/Testing/Unit Testing"

From Mahara Wiki

< Developer Area‎ | Testing
Line 11: Line 11:
 
* Change directory to the root of the mahara git tree (the directory that htdocs is in)
 
* Change directory to the root of the mahara git tree (the directory that htdocs is in)
 
   cd $path_to_mahara
 
   cd $path_to_mahara
* Run phpunit:
+
* Run phpunit, first option only if you have set up your cli for php properly:
 
   phpunit .
 
   phpunit .
 +
OR
 +
  php -c  /etc/php5/apache2/php.ini  /usr/bin/phpunit .
 +
OR
 +
  php -c  /etc/php5/php-fpm/php.ini  /usr/bin/phpunit .
  
 
= Best Practices =
 
= Best Practices =
 
TODO
 
TODO

Revision as of 13:11, 8 September 2011

Unit Test Introduction

Work is currently underway to integrate phpunit unit testing in to Mahara. Documentation for phpunit is available at http://www.phpunit.de/manual/current/en/

Setup and Running

You'll need to already have mahara set up and installed. Default settings are copied from your running configuration and overridden with unit test settings.

 sudo su - www-data
  • Change directory to the root of the mahara git tree (the directory that htdocs is in)
 cd $path_to_mahara
  • Run phpunit, first option only if you have set up your cli for php properly:
 phpunit .
OR
 php -c  /etc/php5/apache2/php.ini  /usr/bin/phpunit .
OR
 php -c  /etc/php5/php-fpm/php.ini  /usr/bin/phpunit .

Best Practices

TODO