class IsFalseValidatorTest in Plug 7
Hierarchy
- class \Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest extends \Symfony\Component\Validator\Tests\Constraints\PHPUnit_Framework_TestCase- class \Symfony\Component\Validator\Tests\Constraints\IsFalseValidatorTest
 
Expanded class hierarchy of IsFalseValidatorTest
File
- lib/Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ IsFalseValidatorTest.php, line 18 
Namespace
Symfony\Component\Validator\Tests\ConstraintsView source
class IsFalseValidatorTest extends AbstractConstraintValidatorTest {
  protected function getApiVersion() {
    return Validation::API_VERSION_2_5;
  }
  protected function createValidator() {
    return new IsFalseValidator();
  }
  public function testNullIsValid() {
    $this->validator
      ->validate(null, new IsFalse());
    $this
      ->assertNoViolation();
  }
  public function testFalseIsValid() {
    $this->validator
      ->validate(false, new IsFalse());
    $this
      ->assertNoViolation();
  }
  public function testTrueIsInvalid() {
    $constraint = new IsFalse(array(
      'message' => 'myMessage',
    ));
    $this->validator
      ->validate(true, $constraint);
    $this
      ->buildViolation('myMessage')
      ->setParameter('{{ value }}', 'true')
      ->assertRaised();
  }
} 
      