function EntityViewControllerTest::testEntityViewControllerViewBuilder

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

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());
}

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