示例#1
0
 public function Test_of_validatesAcceptanceOf()
 {
     $Person = new TestPerson();
     $Person->validatesAcceptanceOf('tos');
     $this->assertEqual($Person->getErrorsOn('tos'), $Person->getDefaultErrorMessageFor('accepted'));
     $Person = new TestPerson();
     $Person->validatesAcceptanceOf('tos', 'You need to type down "I accept this terms and conditions"', "I accept this terms and conditions");
     $this->assertEqual($Person->getErrorsOn('tos'), 'You need to type down "I accept this terms and conditions"');
     $Person->clearErrors();
     $Person->set('tos', "I accept this terms and conditions");
     $this->assertFalse($Person->hasErrors());
 }