public function ValidationVisitorTest::testValidateCascadedPropertyDoesNotValidateNullValues

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ValidationVisitorTest.php, line 540

Class

ValidationVisitorTest
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Tests

Code

public function testValidateCascadedPropertyDoesNotValidateNullValues() {
  $entity = new Entity();
  $entity->reference = null;
  $this->metadata
    ->addPropertyConstraint('reference', new Valid());
  $this->visitor
    ->validate($entity, 'Default', '');
  $this
    ->assertCount(0, $this->visitor
    ->getViolations());
}