New: First change to add PHPUnit

This commit is contained in:
Laurent Destailleur 2010-04-25 14:25:44 +00:00
parent d30c1784ed
commit d3c0d0133a
3 changed files with 10 additions and 7 deletions

View File

@ -26,7 +26,7 @@
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__).'/../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../htdocs/compta/facture/facture.class.php';
require_once dirname(__FILE__).'/../htdocs/compta/facture/class/facture.class.php';
/**
* @backupGlobals enabled

View File

@ -25,11 +25,10 @@
*/
require_once 'PHPUnit/Framework.php';
require_once dirname(__FILE__).'/../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../htdocs/compta/facture/class/facture.class.php';
require_once dirname(__FILE__).'/FactureTest.php';
class FactureTestSuite extends PHPUnit_Framework_TestSuite
class MyTestSuite extends PHPUnit_Framework_TestSuite
{
protected $savconf;
protected $savuser;
@ -68,7 +67,7 @@ class FactureTestSuite extends PHPUnit_Framework_TestSuite
public static function suite()
{
return new FactureTestSuite('FactureTest');
return new MyTestSuite('FactureTest');
}
}

View File

@ -1,11 +1,15 @@
README (English)
--------------------------------
This directory contains unit tests of Dolibarr code.
This directory contains unit tests for Dolibarr code.
To use them, you must:
* Install PHPUnit
* Add an entry in eclipse as external tool for phpunit programm with:
If using Eclipse, you must also add an entry as external tool for phpunit programm with:
-Name: PHPUnit
-Location: /usr/bin/php
-Workspace: ${workspace_loc}
-Arguments: /usr/bin/phpunit ${resource_path}
* To run a test, select it and click on menu "Run external tools and choose PHPUnit"
* Run test by
Running > phpunit testfile.php
If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit".