Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConstraintValidatorTestCase.php

function ConstraintValidatorTestCase::expectValidateAt

File

vendor/symfony/validator/Test/ConstraintValidatorTestCase.php, line 223

Class

ConstraintValidatorTestCase
A test case to ease testing Constraint Validators.

Namespace

Symfony\Component\Validator\Test

Code

protected function expectValidateAt(int $i, string $propertyPath, mixed $value, string|GroupSequence|array|null $group) {
    $validator = $this->context
        ->getValidator()
        ->inContext($this->context);
    $validator->expectValidation($i, $propertyPath, $value, $group, function ($passedConstraints) {
        $expectedConstraints = LogicalOr::fromConstraints(new IsNull(), new IsIdentical([]), new IsInstanceOf(Valid::class));
        Assert::assertThat($passedConstraints, $expectedConstraints);
    });
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal