You are here

protected function PathAliasResourceTestBase::createEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php \Drupal\Tests\path_alias\Functional\Rest\PathAliasResourceTestBase::createEntity()
  2. 9 core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php \Drupal\Tests\path_alias\Functional\Rest\PathAliasResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php, line 49

Class

PathAliasResourceTestBase
Base class for path_alias EntityResource tests.

Namespace

Drupal\Tests\path_alias\Functional\Rest

Code

protected function createEntity() {
  $path_alias = PathAlias::create([
    'path' => '/<front>',
    'alias' => '/frontpage1',
  ]);
  $path_alias
    ->save();
  return $path_alias;
}