示例#1
0
 public function testValidatorsAreEvaluatedWhenRegistered()
 {
     $validator = new FakeValidator();
     $validator->_IsValid = true;
     $validators = new PageValidators(new SmartyPage());
     $validators->Register('someid', $validator);
     $validators->Validate();
     $this->assertTrue($validator->_WasValidated, "should have been validated when registered");
     $this->assertTrue($validators->AreAllValid());
 }
示例#2
0
 public function IsValid()
 {
     try {
         $this->Validate();
         $this->IsValid = $this->Validators->AreAllValid();
         return $this->IsValid;
     } catch (Exception $ex) {
         Log::Error('Error during page validation', $ex);
         return false;
     }
 }