You are here

protected function DigestActionsTest::getTestEntity in Message Digest 8

Helper method to retrieve a test entity given a flag.

Parameters

\Drupal\flag\FlagInterface $flag: The test flag.

Return value

\Drupal\Core\Entity\EntityInterface The test entity.

1 call to DigestActionsTest::getTestEntity()
DigestActionsTest::testActionsNode in message_digest_ui/tests/src/Kernel/DigestActionsTest.php
Test actions.

File

message_digest_ui/tests/src/Kernel/DigestActionsTest.php, line 139

Class

DigestActionsTest
Test message digest actions.

Namespace

Drupal\Tests\message_digest_ui\Kernel

Code

protected function getTestEntity(FlagInterface $flag) {
  switch ($flag
    ->getFlaggableEntityTypeId()) {
    case 'node':
      return $this->nodes[1];
    case 'taxonomy_term':
      return $this->terms[1];
    case 'user':
      return $this->users[1];
  }
}