public function AbstractLegacyApiTest::testTraversableTraverseDisabled in Plug 7
@expectedException \Symfony\Component\Validator\Exception\NoSuchMetadataException
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Validator/ AbstractLegacyApiTest.php, line 78
Class
- AbstractLegacyApiTest
- Verifies that a validator satisfies the API of Symfony < 2.5.
Namespace
Symfony\Component\Validator\Tests\ValidatorCode
public function testTraversableTraverseDisabled() {
$test = $this;
$entity = new Entity();
$traversable = new \ArrayIterator(array(
'key' => $entity,
));
$callback = function () use ($test) {
$test
->fail('Should not be called');
};
$this->metadata
->addConstraint(new Callback(array(
'callback' => $callback,
'groups' => 'Group',
)));
$this->validator
->validate($traversable, 'Group');
}