You are here

protected function EntityQueryAlterTest::createTestEntity in Group 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Kernel/EntityQueryAlterTest.php \Drupal\Tests\group\Kernel\EntityQueryAlterTest::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.

11 calls to EntityQueryAlterTest::createTestEntity()
EntityQueryAlterTest::testGroupAccessWithoutPermission in tests/src/Kernel/EntityQueryAlterTest.php
Tests that grouped test entities are properly hidden for members.
EntityQueryAlterTest::testMemberGroupAccessWithPermission in tests/src/Kernel/EntityQueryAlterTest.php
Tests that grouped test entities are visible to members.
EntityQueryAlterTest::testMemberViewAnyAccess in tests/src/Kernel/EntityQueryAlterTest.php
Tests the viewing of any entities for members.
EntityQueryAlterTest::testMemberViewOwnAccess in tests/src/Kernel/EntityQueryAlterTest.php
Tests the viewing of own entities for members.
EntityQueryAlterTest::testNewGroupContent in tests/src/Kernel/EntityQueryAlterTest.php
Tests that adding new group content clears caches.

... See full list

File

tests/src/Kernel/EntityQueryAlterTest.php, line 327

Class

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