diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 9e751f0f26c..d2cd9c5e7d9 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -130,7 +130,33 @@ class ContratTest extends CommonClassTest print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; $this->assertNotEquals($localobject->date_creation, ''); - return $localobject->id; + return $localobject; + } + + /** + * testContratUpdate + * + * @param Contrat $localobject Object contract + * @return int + * + * @depends testContratOther + * The depends says test is run only if previous is ok + */ + public function testContratUpdate($localobject) + { + global $conf,$user,$langs,$db; + $conf = $this->savconf; + $user = $this->savuser; + $langs = $this->savlangs; + $db = $this->savdb; + + $localobject->note_private = 'New private note'; + + $result = $localobject->update($user); + + print __METHOD__." id=".$localobject->id." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $result; } /** @@ -139,7 +165,7 @@ class ContratTest extends CommonClassTest * @param int $id Id of contract * @return int * - * @depends testContratOther + * @depends testContratUpdate * The depends says test is run only if previous is ok */ public function testContratDelete($id)