function RecursiveContextualValidatorTest::testValidatePropertyWithCustomGroup

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php \Drupal\Tests\Core\TypedData\RecursiveContextualValidatorTest::testValidatePropertyWithCustomGroup()
  2. 10 core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php \Drupal\Tests\Core\TypedData\RecursiveContextualValidatorTest::testValidatePropertyWithCustomGroup()
  3. 11.x core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php \Drupal\Tests\Core\TypedData\RecursiveContextualValidatorTest::testValidatePropertyWithCustomGroup()

@covers ::validateProperty

File

core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php, line 227

Class

RecursiveContextualValidatorTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21TypedData%21Validation%21RecursiveContextualValidator.php/class/RecursiveContextualValidator/9" title="Defines a recursive contextual validator for Typed Data." class="local">\Drupal\Core\TypedData\Validation\RecursiveContextualValidator</a> @group typedData

Namespace

Drupal\Tests\Core\TypedData

Code

public function testValidatePropertyWithCustomGroup() {
    $tree = [
        'value' => [],
        'properties' => [
            'key1' => [
                'value' => 'value1',
            ],
        ],
    ];
    $typed_data = $this->setupTypedData($tree, 'test_name');
    $this->expectException(\LogicException::class);
    $this->recursiveValidator
        ->validateProperty($typed_data, 'key1', 'test group');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.