function InternalViolationTest::testSetGetArrayPropertyPath

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Field/InternalViolationTest.php \Drupal\Tests\Core\Field\InternalViolationTest::testSetGetArrayPropertyPath()
  2. 11.x core/tests/Drupal/Tests/Core/Field/InternalViolationTest.php \Drupal\Tests\Core\Field\InternalViolationTest::testSetGetArrayPropertyPath()

@covers ::__get
@covers ::__set

File

core/tests/Drupal/Tests/Core/Field/InternalViolationTest.php, line 33

Class

InternalViolationTest
@coversDefaultClass \Drupal\Core\Field\InternalViolation[[api-linebreak]] @group legacy

Namespace

Drupal\Tests\Core\Field

Code

public function testSetGetArrayPropertyPath() : void {
  $violation = new InternalViolation($this->prophesize(ConstraintViolationInterface::class)
    ->reveal());
  $this->expectDeprecation('Accessing the arrayPropertyPath property is deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. Use \\Symfony\\Component\\Validator\\ConstraintViolationInterface::getPropertyPath() instead. See https://www.drupal.org/node/3307919');
  $violation->arrayPropertyPath = [
    'bar',
  ];
  $this->assertSame([
    'bar',
  ], $violation->arrayPropertyPath);
}

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