New: First change to add PHPUnit
This commit is contained in:
parent
d30c1784ed
commit
d3c0d0133a
@ -26,7 +26,7 @@
|
|||||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||||
require_once 'PHPUnit/Framework.php';
|
require_once 'PHPUnit/Framework.php';
|
||||||
require_once dirname(__FILE__).'/../htdocs/master.inc.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
|
* @backupGlobals enabled
|
||||||
|
|||||||
@ -25,11 +25,10 @@
|
|||||||
*/
|
*/
|
||||||
require_once 'PHPUnit/Framework.php';
|
require_once 'PHPUnit/Framework.php';
|
||||||
require_once dirname(__FILE__).'/../htdocs/master.inc.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';
|
require_once dirname(__FILE__).'/FactureTest.php';
|
||||||
|
|
||||||
|
|
||||||
class FactureTestSuite extends PHPUnit_Framework_TestSuite
|
class MyTestSuite extends PHPUnit_Framework_TestSuite
|
||||||
{
|
{
|
||||||
protected $savconf;
|
protected $savconf;
|
||||||
protected $savuser;
|
protected $savuser;
|
||||||
@ -68,7 +67,7 @@ class FactureTestSuite extends PHPUnit_Framework_TestSuite
|
|||||||
|
|
||||||
public static function suite()
|
public static function suite()
|
||||||
{
|
{
|
||||||
return new FactureTestSuite('FactureTest');
|
return new MyTestSuite('FactureTest');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
10
test/README
10
test/README
@ -1,11 +1,15 @@
|
|||||||
README (English)
|
README (English)
|
||||||
--------------------------------
|
--------------------------------
|
||||||
This directory contains unit tests of Dolibarr code.
|
This directory contains unit tests for Dolibarr code.
|
||||||
To use them, you must:
|
To use them, you must:
|
||||||
|
|
||||||
* Install PHPUnit
|
* 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
|
-Name: PHPUnit
|
||||||
-Location: /usr/bin/php
|
-Location: /usr/bin/php
|
||||||
-Workspace: ${workspace_loc}
|
-Workspace: ${workspace_loc}
|
||||||
-Arguments: /usr/bin/phpunit ${resource_path}
|
-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".
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user