function EntityConstraintViolationListTest::setupEntity
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::setupEntity()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::setupEntity()
- 11.x core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php \Drupal\Tests\Core\Entity\EntityConstraintViolationListTest::setupEntity()
Builds the entity.
Parameters
\Drupal\Core\Session\AccountInterface $account: An account.
Return value
\Drupal\Core\Field\FieldItemListInterface A fieldable entity.
5 calls to EntityConstraintViolationListTest::setupEntity()
- EntityConstraintViolationListTest::testFilterByFieldAccess in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php - @covers ::filterByFieldAccess
- EntityConstraintViolationListTest::testFilterByFieldAccessWithCompositeConstraint in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php - @covers ::filterByFieldAccess
- EntityConstraintViolationListTest::testFilterByFields in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php - @covers ::filterByFields
- EntityConstraintViolationListTest::testFilterByFieldsWithCompositeConstraints in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php - @covers ::filterByFields
- EntityConstraintViolationListTest::testFindByCodes in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php - @covers ::findByCodes
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityConstraintViolationListTest.php, line 105
Class
- EntityConstraintViolationListTest
- @coversDefaultClass \Drupal\Core\Entity\EntityConstraintViolationList @group entity
Namespace
Drupal\Tests\Core\EntityCode
protected function setupEntity(AccountInterface $account) {
$prophecy = $this->prophesize('\\Drupal\\Core\\Field\\FieldItemListInterface');
$prophecy->access('edit', $account)
->willReturn(FALSE);
$name_field_item_list = $prophecy->reveal();
$prophecy = $this->prophesize('\\Drupal\\Core\\Field\\FieldItemListInterface');
$prophecy->access('edit', $account)
->willReturn(TRUE);
$type_field_item_list = $prophecy->reveal();
$prophecy = $this->prophesize('\\Drupal\\Core\\Entity\\FieldableEntityInterface');
$prophecy->hasField('name')
->willReturn(TRUE);
$prophecy->hasField('type')
->willReturn(TRUE);
$prophecy->get('name')
->willReturn($name_field_item_list);
$prophecy->get('type')
->willReturn($type_field_item_list);
return $prophecy->reveal();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.