From b0a065ce02a2519f323b727e0ba869ee0e1d313b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 May 2010 17:35:36 +0000 Subject: [PATCH] Update unit tests --- test/AdherentTest.php | 18 ++++++++++++++++++ test/CommandeTest.php | 18 ++++++++++++++++++ test/ContratTest.php | 20 ++++++++++++++++++++ test/FactureTest.php | 20 +++++++++++++++++++- test/PropalTest.php | 20 ++++++++++++++++++++ test/UserGroupTest.php | 18 ++++++++++++++++++ test/UserTest.php | 19 +++++++++++++++++++ 7 files changed, 132 insertions(+), 1 deletion(-) diff --git a/test/AdherentTest.php b/test/AdherentTest.php index bb4a5731726..8b82eb0f73d 100644 --- a/test/AdherentTest.php +++ b/test/AdherentTest.php @@ -210,6 +210,24 @@ 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/CommandeTest.php b/test/CommandeTest.php index ef0c22f22a3..c43d550ce74 100644 --- a/test/CommandeTest.php +++ b/test/CommandeTest.php @@ -207,6 +207,24 @@ class CommandeTest 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 Commande($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/ContratTest.php b/test/ContratTest.php index b58f9736894..a1da26ea4cc 100644 --- a/test/ContratTest.php +++ b/test/ContratTest.php @@ -213,5 +213,25 @@ class ContratTest extends PHPUnit_Framework_TestCase } + /** + * + */ + public function testVerifyNumRef() + { + global $conf,$user,$langs,$db; + $conf=$this->savconf; + $user=$this->savuser; + $langs=$this->savlangs; + $db=$this->savdb; + + $localobject=new Contrat($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/FactureTest.php b/test/FactureTest.php index 531b98e4432..032e614f8a8 100644 --- a/test/FactureTest.php +++ b/test/FactureTest.php @@ -184,7 +184,7 @@ class FactureTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $result=$localobject->set_valid($user); + $result=$localobject->validate($user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -212,6 +212,24 @@ class FactureTest 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 Facture($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/PropalTest.php b/test/PropalTest.php index 0c7b37fd3ee..3bcaa2edd8b 100644 --- a/test/PropalTest.php +++ b/test/PropalTest.php @@ -207,5 +207,25 @@ class PropalTest 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 Propal($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/UserGroupTest.php b/test/UserGroupTest.php index b477615bb17..2f2adc4b74e 100644 --- a/test/UserGroupTest.php +++ b/test/UserGroupTest.php @@ -229,6 +229,24 @@ class UserGroupTest 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 UserGroup($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/UserTest.php b/test/UserTest.php index 5cb38c2b0a1..91c2d4b03f4 100644 --- a/test/UserTest.php +++ b/test/UserTest.php @@ -210,6 +210,25 @@ class UserTest 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 User($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