You are here

protected function LogTestBase::createLogEntity in Log entity 8

Parameters

array $values:

Return value

\Drupal\log\LogInterface

3 calls to LogTestBase::createLogEntity()
LogCRUDTest::testDeleteLog in src/Tests/LogCRUDTest.php
Delete log entity.
LogCRUDTest::testEditLog in src/Tests/LogCRUDTest.php
Edit log entity.
LogCRUDTest::testViewLog in src/Tests/LogCRUDTest.php
Display log entity.

File

src/Tests/LogTestBase.php, line 71

Class

LogTestBase
Tests the Log CRUD.

Namespace

Drupal\log\Tests

Code

protected function createLogEntity($values = []) {
  $storage = \Drupal::service('entity_type.manager')
    ->getStorage('log');
  $entity = $storage
    ->create($values + [
    'name' => $this
      ->randomMachineName(),
    'user_id' => $this->loggedInUser
      ->id(),
    'created' => REQUEST_TIME,
    'type' => 'default',
    'done' => TRUE,
  ]);
  return $entity;
}