dolibarr/test/phpunit/README

44 lines
1.4 KiB
Plaintext
Raw Normal View History

2010-04-25 16:19:58 +02:00
README (English)
--------------------------------
2010-05-06 00:41:54 +02:00
This directory contains unit tests and docs for
Dolibarr quality analysis.
PHPUNIT
-------
2010-04-25 16:19:58 +02:00
To use them, you must:
2010-04-25 16:25:44 +02:00
2010-04-25 16:19:58 +02:00
* Install PHPUnit
2010-04-25 16:25:44 +02:00
If using Eclipse, you must also add an entry as external tool for phpunit programm with:
2010-04-25 16:19:58 +02:00
-Name: PHPUnit
2010-04-27 01:20:14 +02:00
-Location: Linux: /usr/bin/php
Windows: C:\Program Files (x86)\wamp\bin\php\php5.2.8\php.exe
2010-04-25 16:19:58 +02:00
-Workspace: ${workspace_loc}
2010-04-27 01:20:14 +02:00
-Arguments: Linux: /usr/bin/phpunit ${resource_path}
Windows: "C:\Program Files (x86)\PHPUnit-3.4.9\phpunit.php" ${resource_path}
2010-04-25 16:25:44 +02:00
2010-04-27 01:20:14 +02:00
* Run Unit tests:
2010-04-25 16:48:12 +02:00
Run > phpunit TestFile.php
2010-04-25 16:25:44 +02:00
If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit".
2010-04-25 16:48:12 +02:00
2010-04-27 11:05:42 +02:00
* Generate a report of Unit tests code coverage among tested classes only:
Run > phpunit --coverage-html ./report MyTestSuite.php
2010-04-25 16:48:12 +02:00
Note that xdebug must be installed for this feature to work.
2010-04-27 01:20:14 +02:00
2010-04-27 11:05:42 +02:00
* Generate a report of Unit tests code coverage among all Dolibarr classes:
2010-04-27 13:21:34 +02:00
Increase your PHP memory (memory_limit in php.ini) to 528MB.
2010-05-05 20:18:09 +02:00
Check that you use the "mysqli" driver in your conf.php file (otherwise
edit the file phpunittest.xml).
2010-04-27 11:05:42 +02:00
Run > phpunit --configuration ./phpunittest.xml --coverage-html ./report MyTestSuite.php
2010-05-06 00:41:54 +02:00
PHPDEPEND
---------
* Install PDepend
* Laucnh PDepend analysis:
pdepend --summary-xml=./report/summary.xml --jdepend-chart=./report/jdepend.svg --overview-pyramid=./report/pyramid.svg /yourdir