/**
  * Ensures that getMessage() returns the correct value if a validator was
  * passed as constructor argument.
  */
 public function testGetMessageReturnsCorrectValueIfValidatorWasProvided()
 {
     $validator = new Mol_Validate_False('My error message.');
     // Call isValid() to ensure that the message is available.
     $validator->isValid(false);
     $exception = new Mol_Controller_Exception_ParameterNotValid($validator);
     $this->assertEquals('My error message.', $exception->getMessage());
 }
示例#2
0
 /**
  * Ensures that isValid() returns false if a boolean is validated.
  */
 public function testIsValidReturnsFalseForBoolean()
 {
     $this->assertFalse($this->validator->isValid(true));
 }