You are here

protected function CommentAlterTestBase::createEntityObject in Comment Alter 8

Creates an entity object with the provided values.

Parameters

array $values: (optional) An array of values to set, keyed by property name.

10 calls to CommentAlterTestBase::createEntityObject()
CommentAlterImageTest::testImageFieldMultiple in tests/src/Functional/CommentAlterImageTest.php
Tests for multi valued image field comment altering.
CommentAlterImageTest::testImageFieldSingle in tests/src/Functional/CommentAlterImageTest.php
Tests for single valued image field comment altering.
CommentAlterListStringTest::testOptionsButtonMultiple in tests/src/Functional/CommentAlterListStringTest.php
Tests for multi-valued List (string) fields comment altering.
CommentAlterListStringTest::testOptionsButtonSingle in tests/src/Functional/CommentAlterListStringTest.php
Tests for single valued List (string) fields comment altering.
CommentAlterListStringTest::testOptionsSelectMultiple in tests/src/Functional/CommentAlterListStringTest.php
Tests for multi-valued List (string) fields comment altering.

... See full list

File

tests/src/Functional/CommentAlterTestBase.php, line 151

Class

CommentAlterTestBase
Base class for Comment Alter test cases.

Namespace

Drupal\Tests\comment_alter\Functional

Code

protected function createEntityObject($values = []) {

  // Create a test entity object for the entity_test_bundle.
  $random_label = $this
    ->randomMachineName();
  $data = [
    'type' => $this->bundle,
    'name' => $random_label,
  ] + $values;
  $this->entity = EntityTestRev::create($data);
  $this->entity
    ->save();
}