You are here

public function AbstractValidatorTest::testIgnoreNullDuringArrayTraversal in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php \Symfony\Component\Validator\Tests\Validator\AbstractValidatorTest::testIgnoreNullDuringArrayTraversal()

File

vendor/symfony/validator/Tests/Validator/AbstractValidatorTest.php, line 660

Class

AbstractValidatorTest
@since 2.5

Namespace

Symfony\Component\Validator\Tests\Validator

Code

public function testIgnoreNullDuringArrayTraversal() {
  $entity = new Entity();
  $entity->reference = array(
    null,
  );
  $this->metadata
    ->addPropertyConstraint('reference', new Valid());
  $violations = $this
    ->validate($entity);

  /* @var ConstraintViolationInterface[] $violations */
  $this
    ->assertCount(0, $violations);
}