class IsTrueValidatorTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/Constraints/IsTrueValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\IsTrueValidatorTest
 
Hierarchy
- class \Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest extends \Symfony\Component\Validator\Tests\Constraints\PHPUnit_Framework_TestCase
- class \Symfony\Component\Validator\Tests\Constraints\IsTrueValidatorTest
 
 
Expanded class hierarchy of IsTrueValidatorTest
File
- vendor/
symfony/ validator/ Tests/ Constraints/ IsTrueValidatorTest.php, line 18  
Namespace
Symfony\Component\Validator\Tests\ConstraintsView source
class IsTrueValidatorTest extends AbstractConstraintValidatorTest {
  protected function getApiVersion() {
    return Validation::API_VERSION_2_5;
  }
  protected function createValidator() {
    return new IsTrueValidator();
  }
  public function testNullIsValid() {
    $this->validator
      ->validate(null, new IsTrue());
    $this
      ->assertNoViolation();
  }
  public function testTrueIsValid() {
    $this->validator
      ->validate(true, new IsTrue());
    $this
      ->assertNoViolation();
  }
  public function testFalseIsInvalid() {
    $constraint = new IsTrue(array(
      'message' => 'myMessage',
    ));
    $this->validator
      ->validate(false, $constraint);
    $this
      ->buildViolation('myMessage')
      ->setParameter('{{ value }}', 'false')
      ->assertRaised();
  }
}