diff --git a/test/README b/test/README index 012d8cf44e2..5c18fe96506 100644 --- a/test/README +++ b/test/README @@ -30,11 +30,19 @@ If not using Eclipse, to install PHPUnit manually: > sudo pear upgrade-all > sudo pear install --alldeps phpunit/PHPUnit + * Run Unit tests: > cd test/phpunit > phpunit MyFileTest.php If using Eclipse, select the test and click on menu "Run external tools and choose PHPUnit". +* Example to run phpunit 7.0 from composer using php version 8.0: +> cd ~/tmp +> composer -i phpunit +> cd test/phpunit +> /usr/bin/php8.0 ~/tmp/htdocs/includes/phpunit/phpunit/phpunit MyFileTest.php + + * Generate a report of Unit tests code coverage done by one tested class: > cd test > phpunit -d memory_limit=-1 -d max_input_time=1800 -d max_execution_time=1800 --configuration ./phpunit/phpunittest.xml --coverage-html ./report ./report/logs/phpunit.xml phpunit/MyClassTest.php diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 79e3013ae11..8fd67576a7e 100644 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -136,13 +136,16 @@ class ModulesTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $modulelist=array('Accounting','Adherent','Agenda','Api','Asset','Banque','Barcode','BlockedLog','Bookmark', - 'CashDesk','Categorie','ClickToDial','Collab','Commande','Comptabilite','Contrat','Cron','DataPolicy','Dav','Deplacement','DocumentGeneration','Don','DynamicPrices', - 'ECM','EmailCollector','Expedition','ExpenseReport','Export','ExternalRss','ExternalSite', - 'Facture','Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Holiday','HRM','Import','Incoterm','Label','Ldap','Loan', - 'Mailing','MailmanSpip','Margin','ModuleBuilder','MultiCurrency', - 'Notification','Oauth','OpenSurvey','Paybox','Paypal','Prelevement','Printing','Product','ProductBatch','Projet','Propale','ReceiptPrinter','Resource', - 'Salaries','Service','SocialNetworks','Societe','Stock','Stripe','SupplierProposal','Syslog','TakePos','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow'); + $modulelist=array('Accounting','Adherent','Agenda','Api','Asset','Banque','Barcode','BlockedLog','Bom','Bookmark', + 'Categorie','ClickToDial','Collab','Commande','Comptabilite','Contrat','Cron','DataPolicy','Dav','DebugBar','Deplacement','DocumentGeneration','Don','DynamicPrices', + 'ECM','EmailCollector','EventOrganization','Expedition','ExpenseReport','Export','ExternalRss','ExternalSite', + 'Facture','Fckeditor','Ficheinter','Fournisseur','FTP','GeoIPMaxmind','Gravatar','Holiday','HRM','Import','Incoterm','Intracommreport', + 'KnowledgeManagement','Label','Ldap','Loan', + 'Mailing','MailmanSpip','Margin','ModuleBuilder','Mrp','MultiCurrency', + 'Notification','Oauth','OpenSurvey','Paybox','PaymentByBankTransfer','Paypal','Prelevement','Printing','Product','ProductBatch','Projet','Propale', + 'ReceiptPrinter','Reception','Recruitment','Resource', + 'Salaries','Service','SocialNetworks','Societe','Stock','Stripe','SupplierProposal','Syslog', + 'TakePos','Tax','Ticket','User','Variants','WebServices','WebServicesClient','Website','Workflow','Workstation','Zapier'); foreach ($modulelist as $modlabel) { require_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'; $class='mod'.$modlabel;