You are here

protected function EntityAccessTest::createTestEntity in Group 8

Same name and namespace in other branches
  1. 2.0.x 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.

... See full list

File

tests/src/Kernel/EntityAccessTest.php, line 577

Class

EntityAccessTest
Tests that Group properly checks access for grouped entities.

Namespace

Drupal\Tests\group\Kernel

Code

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;
}