Ejemplo n.º 1
0
 /**
  * Test member agreement
  * @group IL_Init
  */
 public function testMemberAgreement()
 {
     include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
     global $ilDB;
     $agree = new ilMemberAgreement(9999, 8888);
     $agree->read();
     $agree->setAccepted(true);
     $agree->save();
     $agree = new ilMemberAgreement(9999, 8888);
     $agree->read();
     $sta = $agree->isAccepted();
     $this->assertEquals($sta, true);
     $agree->delete();
     $agree = new ilMemberAgreement(9999, 8888);
     $agree->read();
     $sta = $agree->isAccepted();
     $this->assertEquals($sta, false);
     $sta = ilMemberAgreement::_hasAccepted(9999, 8888);
     $this->assertEquals($sta, false);
     $agree = new ilMemberAgreement(9999, 8888);
     $agree->read();
     $agree->setAccepted(true);
     $agree->save();
     $sta = ilMemberAgreement::_hasAgreementsByObjId(8888);
     $this->assertEquals($sta, true);
     $sta = ilMemberAgreement::_hasAgreements();
     $this->assertEquals($sta, true);
     ilMemberAgreement::_deleteByUser(9999);
 }
 /**
  * Show list of custom fields
  * @return 
  */
 protected function show()
 {
     if (ilMemberAgreement::_hasAgreementsByObjId($this->getObjId())) {
         ilUtil::sendInfo($this->lng->txt('ps_cdf_warning_modify'));
     }
     $this->listFields();
 }