From 1810189cdac245e9e3ee29b746cacfe9a93b2e87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Feb 2012 13:41:05 +0100 Subject: [PATCH] Doxygen --- test/phpunit/AdherentTest.php | 47 ++++++++++-------- test/phpunit/BuildDocTest.php | 80 +++++++++++++++++++++++++++++++ test/phpunit/CMailFileTest.php | 6 +++ test/phpunit/CategorieTest.php | 51 ++++++++++++-------- test/phpunit/CommonObjectTest.php | 8 ++++ test/phpunit/CoreTest.php | 5 ++ test/phpunit/DateLibTest.php | 28 +++++++++-- test/phpunit/ImportTest.php | 3 ++ test/phpunit/ModulesTest.php | 3 ++ test/phpunit/PricesTest.php | 13 +++-- test/phpunit/ProductTest.php | 10 ++++ test/phpunit/SecurityTest.php | 6 +++ test/phpunit/SocieteTest.php | 7 +++ test/phpunit/UserGroupTest.php | 7 +++ test/phpunit/UserTest.php | 7 +++ test/phpunit/WebservicesTest.php | 14 +++++- 16 files changed, 247 insertions(+), 48 deletions(-) diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 286be96a8fc..9575f1e88a3 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -114,6 +114,9 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentCreate + * + * @return void */ public function testAdherentCreate() { @@ -133,6 +136,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentFetch + * + * @param int $id Id of object to fecth + * @return object Fetched object + * * @depends testAdherentCreate * The depends says test is run only if previous is ok */ @@ -153,6 +161,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentUpdate + * + * @param Adherent $localobject Member instance + * @return Adherent + * * @depends testAdherentFetch * The depends says test is run only if previous is ok */ @@ -215,6 +228,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentValid + * + * @param Adherent $localobject Member instance + * @return Adherent + * * @depends testAdherentUpdate * The depends says test is run only if previous is ok */ @@ -234,6 +252,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentOther + * + * @param Adherent $localobject Member instance + * @return int Id of object + * * @depends testAdherentValid * The depends says test is run only if previous is ok */ @@ -258,6 +281,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase } /** + * testAdherentDelete + * + * @param int $id Id of object to delete + * @return void + * * @depends testAdherentOther * The depends says test is run only if previous is ok */ @@ -278,24 +306,5 @@ class AdherentTest extends PHPUnit_Framework_TestCase return $result; } - /** - * - */ - /*public function testVerifyNumRef() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $localobject=new Adherent($this->savdb); - $result=$localobject->ref='refthatdoesnotexists'; - $result=$localobject->VerifyNumRef(); - print __METHOD__." result=".$result."\n"; - $this->assertEquals($result, 0); - - return $result; - }*/ } ?> \ No newline at end of file diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index b0977142f33..5e44df5fea4 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -29,12 +29,15 @@ global $conf,$user,$langs,$db; require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; +require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.facture.class.php'; require_once dirname(__FILE__).'/../../htdocs/commande/class/commande.class.php'; +require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.commande.class.php'; require_once dirname(__FILE__).'/../../htdocs/comm/propal/class/propal.class.php'; require_once dirname(__FILE__).'/../../htdocs/fichinter/class/fichinter.class.php'; require_once dirname(__FILE__).'/../../htdocs/expedition/class/expedition.class.php'; require_once dirname(__FILE__).'/../../htdocs/projet/class/project.class.php'; require_once dirname(__FILE__).'/../../htdocs/projet/class/task.class.php'; +require_once dirname(__FILE__).'/../../htdocs/fourn/class/fournisseur.product.class.php'; require_once dirname(__FILE__).'/../../htdocs/core/lib/pdf.lib.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/doc/pdf_oursin.modules.php'; @@ -48,7 +51,9 @@ require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_ex require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php'; // Mother classes of pdf generators require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/modules_facture.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/modules_commande.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/supplier_order/modules_commandefournisseur.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/modules_propale.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/project/modules_project.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/modules_fichinter.php'; @@ -146,6 +151,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase } /** + * testFactureBuild + * + * @return int */ public function testFactureBuild() { @@ -178,6 +186,37 @@ class BuildDocTest extends PHPUnit_Framework_TestCase } /** + * testFactureBuild + * + * @return int + */ + public function testFactureFournisseurBuild() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $conf->fournisseur->facture->dir_output.='/temp'; + $localobject=new FactureFournisseur($this->savdb); + $localobject->initAsSpecimen(); + $localobject->socid=1; + + // Canelle + $localobject->modelpdf='canelle'; + $result=supplier_invoice_pdf_create($db, $localobject, $localobject->modelpdf, $langs); + + $this->assertLessThan($result, 0); + print __METHOD__." result=".$result."\n"; + + return 0; + } + + /** + * testCommandeBuild + * + * @return int */ public function testCommandeBuild() { @@ -209,7 +248,39 @@ class BuildDocTest extends PHPUnit_Framework_TestCase return 0; } + /** + * testCommandeFournisseurBuild + * + * @return int + */ + public function testCommandeFournisseurBuild() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $conf->fournisseur->commande->dir_output.='/temp'; + $localobject=new CommandeFournisseur($this->savdb); + $localobject->initAsSpecimen(); + $localobject->socid=1; + + // Muscadet + $localobject->modelpdf='muscadet'; + $result=supplier_order_pdf_create($db, $localobject, $localobject->modelpdf, $langs); + + $this->assertLessThan($result, 0); + print __METHOD__." result=".$result."\n"; + + return 0; + } + + /** + * testPropalBuild + * + * @return int */ public function testPropalBuild() { @@ -242,6 +313,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase } /** + * testProjectBuild + * + * @return int */ public function testProjectBuild() { @@ -267,6 +341,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase } /** + * testFichinterBuild + * + * @return int */ public function testFichinterBuild() { @@ -292,6 +369,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase } /** + * testExpeditionBuild + * + * @return int */ public function testExpeditionBuild() { diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index f7bf4791f7a..8e28276bfb8 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -114,6 +114,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase } /** + * testCMailFileText + * + * @return void */ public function testCMailFileText() { @@ -134,6 +137,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase } /** + * testCMailFileStatic + * + * @return string */ public function testCMailFileStatic() { diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index a5634084c85..24693fdac20 100755 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -115,6 +115,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieCreate + * + * @return int */ public function testCategorieCreate() { @@ -138,6 +141,11 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieProduct + * + * @param int $id Id of category + * @return int + * * @depends testCategorieCreate * The depends says test is run only if previous is ok */ @@ -173,6 +181,11 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieFetch + * + * @param int $id Id of category + * @return int + * * @depends testCategorieProduct * The depends says test is run only if previous is ok */ @@ -193,6 +206,11 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieUpdate + * + * @param Category $localobject Category + * @return int + * @depends testCategorieFetch * The depends says test is run only if previous is ok */ @@ -213,25 +231,11 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** - * @depends testCategorieUpdate - * The depends says test is run only if previous is ok - */ - /*public function testCategorieXXX($localobject) - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $result=$localobject->delete(0); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - - $this->assertLessThan($result, 0); - return $localobject; - }*/ - - /** + * testCategorieOther + * + * @param Category $localobject Category + * @return int + * * @depends testCategorieUpdate * The depends says test is run only if previous is ok */ @@ -262,6 +266,11 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieDelete + * + * @param int $id Id of category + * @return int + * * @depends testCategorieOther * The depends says test is run only if previous is ok */ @@ -283,6 +292,10 @@ class CategorieTest extends PHPUnit_Framework_TestCase } /** + * testCategorieStatic + * + * @return void + * * @depends testCategorieDelete */ public function testCategorieStatic() diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index cae50abe534..42f5503e152 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -116,7 +116,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase /** + * testVerifyNumRef * + * @return void */ public function testVerifyNumRef() { @@ -136,7 +138,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase } /** + * testFetchUser * + * @return void */ public function testFetchUser() { @@ -157,7 +161,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase } /** + * testFetchProjet * + * @return void */ public function testFetchProjet() { @@ -177,7 +183,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase } /** + * testFetchThirdParty * + * @return void */ public function testFetchThirdParty() { diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index a0eeb7404cc..7ca6b78856b 100755 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -40,6 +40,8 @@ if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is /** + * Class to test core functions + * * @backupGlobals disabled * @backupStaticAttributes enabled * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. @@ -114,6 +116,9 @@ class CoreTest extends PHPUnit_Framework_TestCase /** + * testDetectURLROOT + * + * @return void */ public function testDetectURLROOT() { diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 3a9c15db3ee..222fb62a86a 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -113,7 +113,10 @@ class DateLibTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } - /** + /** + * testConvertTime2Seconds + * + * @return void */ public function testConvertTime2Seconds() { @@ -131,6 +134,9 @@ class DateLibTest extends PHPUnit_Framework_TestCase } /** + * testConvertSecondToTime + * + * @return void */ public function testConvertSecondToTime() { @@ -153,7 +159,10 @@ class DateLibTest extends PHPUnit_Framework_TestCase } /** - */ + * testDolPrintDate + * + * @return void + */ public function testDolPrintDate() { global $conf,$user,$langs,$db; @@ -194,7 +203,10 @@ class DateLibTest extends PHPUnit_Framework_TestCase } /** - */ + * testDolTimePlusDuree + * + * @return int + */ public function testDolTimePlusDuree() { global $conf,$user,$langs,$db; @@ -216,7 +228,10 @@ class DateLibTest extends PHPUnit_Framework_TestCase } /** - */ + * testDolStringToTime + * + * @return int + */ public function testDolStringToTime() { global $conf,$user,$langs,$db; @@ -249,7 +264,10 @@ class DateLibTest extends PHPUnit_Framework_TestCase } /** - */ + * testDolGetFirstDay + * + * @return void + */ public function testDolGetFirstDay() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 693a83ecb48..aa31e015b9d 100755 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -117,6 +117,9 @@ class ImportTest extends PHPUnit_Framework_TestCase /** + * testImportSample1 + * + * @return boolean */ public function testImportSample1() { diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 6df87dde2f2..9b2924270e7 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -113,6 +113,9 @@ class ModulesTest extends PHPUnit_Framework_TestCase } /** + * testModulesInit + * + * @return int */ public function testModulesInit() { diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 4554b671692..85cb2f3bbd5 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -90,6 +90,9 @@ class PricesTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -101,7 +104,11 @@ class PricesTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { @@ -121,21 +128,21 @@ class PricesTest extends PHPUnit_Framework_TestCase // qty=1, unit_price=1.24, discount_line=0, vat_rate=10, price_base_type='HT' $result1=calcul_price_total(1, 1.24, 0, 10, 0, 0, 0, 'HT', 0); // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) - + print __METHOD__." value0=1.24 result0=".$result1[0]."\n"; $this->assertEquals(1.24,$result1[0]); print __METHOD__." value1=0.12 result1=".$result1[1]."\n"; $this->assertEquals(0.12,$result1[1]); print __METHOD__." value2=1.36 result2=".$result1[2]."\n"; $this->assertEquals(1.36,$result1[2]); - + print __METHOD__." value3=1.24 result3=".$result1[3]."\n"; $this->assertEquals(1.24, $result1[3]); print __METHOD__." value4=0.124 result4=".$result1[4]."\n"; $this->assertEquals(0.124,$result1[4]); print __METHOD__." value5=1.364 result5=".$result1[5]."\n"; $this->assertEquals(1.364,$result1[5]); - + print __METHOD__." value6=1.24 result6=".$result1[6]."\n"; $this->assertEquals(1.24,$result1[6]); print __METHOD__." value7=0.12 result7=".$result1[7]."\n"; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 7e3f36e6ada..7faae6bd333 100755 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -92,6 +92,9 @@ class ProductTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -103,7 +106,11 @@ class ProductTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { @@ -111,6 +118,9 @@ class ProductTest extends PHPUnit_Framework_TestCase } /** + * testProductCreate + * + * @return void */ public function testProductCreate() { diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 30f1936d985..f4deb98b7a3 100755 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -101,6 +101,9 @@ class SecurityTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -114,6 +117,9 @@ class SecurityTest extends PHPUnit_Framework_TestCase } /** + * End phpunit tests + * + * @return void */ protected function tearDown() { diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 889e473ea25..050488a6e65 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -93,6 +93,9 @@ class SocieteTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -104,7 +107,11 @@ class SocieteTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index e12b3417588..537f47792b9 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -89,6 +89,9 @@ class UserGroupTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -100,7 +103,11 @@ class UserGroupTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 6234007761f..df7aa47987a 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -89,6 +89,9 @@ class UserTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -100,7 +103,11 @@ class UserTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { diff --git a/test/phpunit/WebservicesTest.php b/test/phpunit/WebservicesTest.php index 4b18be9f024..10e8b57a384 100755 --- a/test/phpunit/WebservicesTest.php +++ b/test/phpunit/WebservicesTest.php @@ -91,6 +91,9 @@ class WebservicesTest extends PHPUnit_Framework_TestCase } /** + * Init phpunit tests + * + * @return void */ protected function setUp() { @@ -102,16 +105,23 @@ class WebservicesTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * End phpunit tests + * + * @return void */ protected function tearDown() { print __METHOD__."\n"; } - /** + /** + * testWSVersion + * + * @return int */ - public function testWSVersion() + public function testWSGetVersions() { global $conf,$user,$langs,$db; $conf=$this->savconf;