You are here

protected function WebformBreadcrumbBuilderTest::setSourceEntity in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php \Drupal\Tests\webform\Kernel\Breadcrumb\WebformBreadcrumbBuilderTest::setSourceEntity()

Set request handler's source entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity.

4 calls to WebformBreadcrumbBuilderTest::setSourceEntity()
WebformBreadcrumbBuilderTest::testBuildSourceEntity in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildSourceEntityResults in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity submissions breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildSourceEntitySubmissions in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity submissions breadcrumbs.
WebformBreadcrumbBuilderTest::testBuildSourceEntityUserResults in tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php
Test build source entity submissions breadcrumbs.

File

tests/src/Kernel/Breadcrumb/WebformBreadcrumbBuilderTest.php, line 478

Class

WebformBreadcrumbBuilderTest
Test webform breadcrumb builder.

Namespace

Drupal\Tests\webform\Kernel\Breadcrumb

Code

protected function setSourceEntity(EntityInterface $entity) {

  // Set the node as the request handler's source entity.
  $this->requestHandler
    ->expects($this
    ->any())
    ->method('getCurrentSourceEntity')
    ->will($this
    ->returnValue($entity));
}