function EntityConstraintViolationListTest::testFilterByFieldAccess
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::testFilterByFieldAccess()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::testFilterByFieldAccess()
- 11.x core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::testFilterByFieldAccess()
@covers ::filterByFieldAccess
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php, line 53
Class
- EntityConstraintViolationListTest
- @coversDefaultClass \Drupal\Core\Entity\EntityConstraintViolationList @group entity
Namespace
Drupal\Tests\Core\EntityCode
public function testFilterByFieldAccess() : void {
$account = $this->prophesize('\\Drupal\\Core\\Session\\AccountInterface')
->reveal();
$entity = $this->setupEntity($account);
$constraint_list = $this->setupConstraintListWithoutCompositeConstraint($entity);
$violations = iterator_to_array($constraint_list);
$this->assertSame($constraint_list->filterByFieldAccess($account), $constraint_list);
$this->assertCount(4, $constraint_list);
$this->assertEquals(array_values(iterator_to_array($constraint_list)), [
$violations[2],
$violations[3],
$violations[4],
$violations[5],
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.