function EntityViewControllerTest::testEntityViewControllerViewBuilder

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::testEntityViewControllerViewBuilder()
  2. 8.9.x core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php \Drupal\Tests\system\Functional\Entity\EntityViewControllerTest::testEntityViewControllerViewBuilder()
  3. 10 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 117

Class

EntityViewControllerTest
Tests EntityViewController functionality.

Namespace

Drupal\Tests\system\Functional\Entity

Code

public function testEntityViewControllerViewBuilder() : void {
    $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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.