You are here

public function EntityViewControllerTest::testEntityViewControllerViewBuilder in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::testEntityViewControllerViewBuilder()

Tests that a view builder can successfully override the view builder.

File

core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php, line 129

Class

EntityViewControllerTest
Tests EntityViewController functionality.

Namespace

Drupal\Tests\system\Functional\Entity

Code

public function testEntityViewControllerViewBuilder() {
  $entity_test = $this
    ->createTestEntity('entity_test_view_builder');
  $entity_test
    ->save();
  $this
    ->drupalGet('entity_test_view_builder/' . $entity_test
    ->id());
  $this
    ->assertSession()
    ->pageTextContains($entity_test
    ->label());
}