You are here

public function BreadcrumbTest::setUp in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x modules/entity_hierarchy_breadcrumb/tests/src/Kernel/BreadcrumbTest.php \Drupal\Tests\entity_hierarchy_breadcrumb\Kernel\BreadcrumbTest::setUp()

Overrides EntityHierarchyKernelTestBase::setUp

File

modules/entity_hierarchy_breadcrumb/tests/src/Kernel/BreadcrumbTest.php, line 46

Class

BreadcrumbTest
Tests for breadcrumbs built of entity hierarchy fields.

Namespace

Drupal\Tests\entity_hierarchy_breadcrumb\Kernel

Code

public function setUp() {
  parent::setUp();
  $user = $this
    ->createUser([], [
    'view test entity',
  ]);
  $this->container
    ->get('account_switcher')
    ->switchTo($user);
  $this->breadcrumbBuilder = $this->container
    ->get('entity_hierarchy.breadcrumb');
  $this->testRoute = new Route('/entity_test/{entity_test}', [], [], [
    'parameters' => [
      static::ENTITY_TYPE => [
        'type' => 'entity:' . static::ENTITY_TYPE,
      ],
    ],
  ]);
}