You are here

public function RngWebTestBase::createEntity in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Tests/RngWebTestBase.php \Drupal\rng\Tests\RngWebTestBase::createEntity()
  2. 8 src/Tests/RngWebTestBase.php \Drupal\rng\Tests\RngWebTestBase::createEntity()

Creates an event entity.

Parameters

\Drupal\Core\Config\Entity\ConfigEntityInterface: An entity type.

array $settings: Additional settings for the new entity.

Return value

\Drupal\Core\Entity\EntityInterface An event.

4 calls to RngWebTestBase::createEntity()
RngEventSettingsTest::testEvent in src/Tests/RngEventSettingsTest.php
Create two bundles of the same entity type, one bundle is an event type.
RngEventSettingsTest::testEventSettings in src/Tests/RngEventSettingsTest.php
Tests changing event settings reveals the 'Register' tab.
RngEventSettingsTest::testEventSettingsTabs in src/Tests/RngEventSettingsTest.php
Tests canonical event page, and the Event default local task.
RngRegistrationTypeTest::setUp in src/Tests/RngRegistrationTypeTest.php

File

src/Tests/RngWebTestBase.php, line 56

Class

RngWebTestBase
Sets up page and article content types.

Namespace

Drupal\rng\Tests

Code

public function createEntity(ConfigEntityInterface $entity_type, $settings = []) {

  // @todo change to custom entity
  $entity = $this
    ->drupalCreateNode([
    'type' => $entity_type
      ->id(),
  ] + $settings);
  return $entity;
}