You are here

final class EntityMock in Hook Event Dispatcher 8

Class EntityMock.

Hierarchy

  • class \Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers\EntityMock

Expanded class hierarchy of EntityMock

2 files declare their use of EntityMock
EntityEventTest.php in tests/src/Unit/Preprocess/EntityEventTest.php
EntityEventVariablesTest.php in tests/src/Unit/Preprocess/EntityEventVariablesTest.php

File

tests/src/Unit/Preprocess/Helpers/EntityMock.php, line 8

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers
View source
final class EntityMock {

  /**
   * Entity type.
   *
   * @var string
   */
  private $type;

  /**
   * Entity bundle.
   *
   * @var string
   */
  private $bundle;

  /**
   * View mode.
   *
   * @var string
   */
  private $viewMode;

  /**
   * EntityMock constructor.
   *
   * @param string $type
   *   Entity type.
   * @param string $bundle
   *   Entity bundle.
   * @param string $viewMode
   *   View mode.
   */
  public function __construct($type, $bundle, $viewMode) {
    $this->bundle = $bundle;
    $this->type = $type;
    $this->viewMode = $viewMode;
  }

  /**
   * Get the entity type.
   *
   * @return string
   *   Type.
   */
  public function getEntityType() {
    return $this->type;
  }

  /**
   * Get the entity bundle.
   *
   * @return string
   *   Bundle.
   */
  public function bundle() {
    return $this->bundle;
  }

  /**
   * Get the view mode.
   *
   * @return string
   *   ViewMode.
   */
  public function getViewMode() {
    return $this->viewMode;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityMock::$bundle private property Entity bundle.
EntityMock::$type private property Entity type.
EntityMock::$viewMode private property View mode.
EntityMock::bundle public function Get the entity bundle.
EntityMock::getEntityType public function Get the entity type.
EntityMock::getViewMode public function Get the view mode.
EntityMock::__construct public function EntityMock constructor.