protected function EntityAccessTest::createTestEntity in Group 2.0.x
Same name and namespace in other branches
- 8 tests/src/Kernel/EntityAccessTest.php \Drupal\Tests\group\Kernel\EntityAccessTest::createTestEntity()
Creates a test entity.
Parameters
array $values: (optional) The values used to create the entity.
Return value
\Drupal\entity_test\Entity\EntityTest The created test entity entity.
17 calls to EntityAccessTest::createTestEntity()
- EntityAccessTest::testMemberDeleteAnyAccess in tests/
src/ Kernel/ EntityAccessTest.php - Tests the deleting of any grouped entities for members.
- EntityAccessTest::testMemberDeleteOwnAccess in tests/
src/ Kernel/ EntityAccessTest.php - Tests the deleting of own grouped entities for members.
- EntityAccessTest::testMemberGroupAccessWithoutPermission in tests/
src/ Kernel/ EntityAccessTest.php - Tests that grouped test entities are properly hidden.
- EntityAccessTest::testMemberGroupAccessWithPermission in tests/
src/ Kernel/ EntityAccessTest.php - Tests that grouped test entities are visible to members.
- EntityAccessTest::testMemberUpdateAnyAccess in tests/
src/ Kernel/ EntityAccessTest.php - Tests the updating of any grouped entities for members.
File
- tests/
src/ Kernel/ EntityAccessTest.php, line 577
Class
- EntityAccessTest
- Tests that Group properly checks access for grouped entities.
Namespace
Drupal\Tests\group\KernelCode
protected function createTestEntity(array $values = []) {
$test_entity = $this->storage
->create($values + [
'name' => $this
->randomString(),
]);
$test_entity
->enforceIsNew();
$this->storage
->save($test_entity);
return $test_entity;
}