public function CollectionValidatorTest::testMissingFieldsDisallowed

File

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

Class

CollectionValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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