From d3c0d0133ad36480ca284dbfd1e1fa9f90b491f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Sun, 25 Apr 2010 14:25:44 +0000 Subject: [PATCH] New: First change to add PHPUnit --- test/FactureTest.php | 2 +- test/{FactureTestSuite.php => MyTestSuite.php} | 5 ++--- test/README | 10 +++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) rename test/{FactureTestSuite.php => MyTestSuite.php} (91%) diff --git a/test/FactureTest.php b/test/FactureTest.php index 6a96c0e277a..89b01092dcf 100644 --- a/test/FactureTest.php +++ b/test/FactureTest.php @@ -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 diff --git a/test/FactureTestSuite.php b/test/MyTestSuite.php similarity index 91% rename from test/FactureTestSuite.php rename to test/MyTestSuite.php index aa68f01836e..f61fd120cf0 100644 --- a/test/FactureTestSuite.php +++ b/test/MyTestSuite.php @@ -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'); } } diff --git a/test/README b/test/README index 440da106fc4..5c5d5a97d8b 100644 --- a/test/README +++ b/test/README @@ -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" \ No newline at end of file + +* Run test by +Running > phpunit testfile.php +If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit". -- GitLab