You are here

public function AbstractValidatorTest::testMetadataMustExistIfTraversalIsDisabled in Plug 7

@expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php, line 735

Class

AbstractValidatorTest
@since 2.5 @author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Tests\Validator

Code

public function testMetadataMustExistIfTraversalIsDisabled() {
  $entity = new Entity();
  $entity->reference = new \ArrayIterator();
  $this->metadata
    ->addPropertyConstraint('reference', new Valid(array(
    'traverse' => false,
  )));
  $this
    ->validate($entity);
}