public function CollectionValidatorTest::testRequiredFieldNotPresent

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php, line 327

Class

CollectionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testRequiredFieldNotPresent() {
  $data = $this
    ->prepareTestData(array());
  $this->context
    ->expects($this
    ->once())
    ->method('addViolationAt')
    ->with('[foo]', 'myMessage', array(
    '{{ field }}' => 'foo',
  ));
  $this->validator
    ->validate($data, new Collection(array(
    'fields' => array(
      'foo' => new Required(),
    ),
    'missingFieldsMessage' => 'myMessage',
  )));
}