You are here

protected function PlanTestBase::createPlanEntity in farmOS 2.x

Creates a plan entity.

Parameters

array $values: Array of values to feed the entity.

Return value

\Drupal\plan\Entity\PlanInterface The plan entity.

5 calls to PlanTestBase::createPlanEntity()
PlanCRUDTest::testArchivePlan in modules/core/plan/tests/src/Functional/PlanCRUDTest.php
Plan archiving.
PlanCRUDTest::testArchivePlanViaTimestamp in modules/core/plan/tests/src/Functional/PlanCRUDTest.php
Plan archiving/unarchiving via timestamp.
PlanCRUDTest::testDeletePlan in modules/core/plan/tests/src/Functional/PlanCRUDTest.php
Delete plan entity.
PlanCRUDTest::testEditPlan in modules/core/plan/tests/src/Functional/PlanCRUDTest.php
Edit plan entity.
PlanCRUDTest::testViewPlan in modules/core/plan/tests/src/Functional/PlanCRUDTest.php
Display plan entity.

File

modules/core/plan/tests/src/Functional/PlanTestBase.php, line 72

Class

PlanTestBase
Tests the plan CRUD.

Namespace

Drupal\Tests\plan\Functional

Code

protected function createPlanEntity(array $values = []) {
  $storage = \Drupal::service('entity_type.manager')
    ->getStorage('plan');
  $entity = $storage
    ->create($values + [
    'name' => $this
      ->randomMachineName(),
    'created' => \Drupal::time()
      ->getRequestTime(),
    'type' => 'default',
  ]);
  return $entity;
}