Esempio n. 1
0
 /**
  * testAdherentResiliate
  *
  * @param   Adherent    $localobject    Member instance
  * @return  Adherent
  *
  * @depends testAdherentOther
  * The depends says test is run only if previous is ok
  */
 public function testAdherentResiliate(Adherent $localobject)
 {
     global $conf, $user, $langs, $db;
     $conf = $this->savconf;
     $user = $this->savuser;
     $langs = $this->savlangs;
     $db = $this->savdb;
     //Let's resilie un adherent
     $result = $localobject->resiliate($user);
     print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n";
     $this->assertEquals($result, 1);
     //Is statut updated?
     $this->assertEquals($localobject->statut, 0);
     //We update the object and let's check if it was updated on DB
     $localobject->fetch($localobject->id);
     $this->assertEquals($localobject->statut, 0);
     //Now that status=0, resiliate should return 0
     $result = $localobject->resiliate($user);
     print __METHOD__ . " id=" . $localobject->id . " result=" . $result . "\n";
     $this->assertEquals($result, 0);
     return $localobject;
 }