You are here

function RngWebTestBase::createEntity in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Tests/RngWebTestBase.php \Drupal\rng\Tests\RngWebTestBase::createEntity()
  2. 3.x 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
Sets up a Drupal site for running functional and integration tests.

File

src/Tests/RngWebTestBase.php, line 57

Class

RngWebTestBase
Sets up page and article content types.

Namespace

Drupal\rng\Tests

Code

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

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