dolibarr/test/phpunit
2011-02-13 10:25:13 +00:00
..
.cvsignore Add selenium tests 2010-08-15 23:19:46 +00:00
AdherentTest.php Change to make unit test easier 2011-02-13 10:25:13 +00:00
AllTests.php Change to make unit test easier 2011-02-13 10:25:13 +00:00
BuildDocTest.php Enhance phpunit tests 2010-12-13 11:27:41 +00:00
CategorieTest.php Fix: Use delete function instead of remove 2011-02-06 10:59:17 +00:00
ChargeSocialesTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
CMailFileTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
CommandeFournisseurTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
CommandeTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
CommonObjectTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
CompanyBankAccountTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
ContratTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
DateLibTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
FactureFournisseurTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
FactureTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
ModulesTest.php Moved domain module to external modules 2011-02-12 11:03:29 +00:00
phpunit.dtd Fix: Removed warning no dtd found 2011-01-12 14:33:57 +00:00
phpunittest.xml Change to make unit test easier 2011-02-13 10:25:13 +00:00
PropalTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
README Change to make unit test easier 2011-02-13 10:25:13 +00:00
SecurityTest.php Add more php units 2010-11-20 15:25:08 +00:00
SocieteTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
UserGroupTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00
UserTest.php Increase unit test code coverage (now 21%) 2010-10-26 19:47:19 +00:00

README (English)
--------------------------------
This directory contains unit tests and docs for
Dolibarr quality analysis.



PHPUNIT
-------

To use them, you must:

* Install PHPUnit
If using Eclipse, you must also add an entry as external tool for phpunit programm with:
-Name:      PHPUnit
-Location:  Linux:   /usr/bin/php
            Windows: C:\Program Files (x86)\wamp\bin\php\php5.2.8\php.exe
-Workspace: ${workspace_loc}
-Arguments: Linux:   /usr/bin/phpunit ${resource_path}
            Windows: "C:\Program Files (x86)\PHPUnit-3.4.9\phpunit.php" ${resource_path}

* Run Unit tests: 
> cd test
> phpunit MyFileTest.php
If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit".

* Generate a report of Unit tests code coverage among tested classes only:
> cd test
> phpunit -d memory_limit=-1 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml MyClassTest.php
Note that xdebug must be installed for this feature to work.

* Generate a report of Unit tests code coverage among all Dolibarr classes:
Increase your PHP memory (memory_limit in php.ini) to 512MB.
Check that you use the "mysqli" driver in your conf.php file (otherwise
edit the file phpunittest.xml).
> cd test
> phpunit -d memory_limit=-1 --configuration ./phpunit/phpunittest.xml --coverage-html ./report --coverage-clover ./report/logs/phpunit.coverage.xml --log-junit ./report/logs/phpunit.xml AllTests.php



PHPDEPEND
---------
* Install PDepend

* Launch PDepend analysis:
> cd test
> pdepend --debug -d memory_limit=-1 --configuration=./phpunit/phpunittest.xml --phpunit-xml=./report/logs/pdepend.xml --summary-xml=./report/logs/summary.xml --jdepend-chart=./report/logs/jdepend.svg --overview-pyramid=./report/logs/pyramid.svg dirtoscan