function RecursiveContextualValidatorTest::testValidatePropertyValueWithInvalidObjects

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

Tests validate property value with invalid objects.

@legacy-covers ::validatePropertyValue

Attributes

#[DataProvider('providerTestValidatePropertyWithInvalidObjects')]

File

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

Class

RecursiveContextualValidatorTest
Tests Drupal\Core\TypedData\Validation\RecursiveContextualValidator.

Namespace

Drupal\Tests\Core\TypedData

Code

public function testValidatePropertyValueWithInvalidObjects($object) : void {
  $this->expectException(\InvalidArgumentException::class);
  $this->recursiveValidator
    ->validatePropertyValue($object, 'key1', [], NULL);
}

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