You are here

public function FacetResourceTestBase::createEntity in Facets 8

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides EntityResourceTestBase::createEntity

File

tests/src/Functional/Rest/FacetResourceTestBase.php, line 43

Class

FacetResourceTestBase
Class FacetResourceTestBase.

Namespace

Drupal\Tests\facets\Functional\Rest

Code

public function createEntity() {
  $facet = Facet::create();
  $facet
    ->set('id', 'owl');
  $facet
    ->set('uuid', 'uuid-owl');
  $facet
    ->setWidget('links', [
    'show_numbers' => TRUE,
  ]);
  $facet
    ->addProcessor([
    'processor_id' => 'url_processor_handler',
    'weights' => [
      'pre_query' => -10,
      'build' => -10,
    ],
    'settings' => [],
  ]);
  $facet
    ->setEmptyBehavior([
    'behavior' => 'none',
  ]);
  $facet
    ->save();
  return $facet;
}