function EntityTypeManagerTest::testGetListBuilder

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testGetListBuilder()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testGetListBuilder()
  3. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::testGetListBuilder()

Tests the getListBuilder() method.

@covers ::getListBuilder

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php, line 186

Class

EntityTypeManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityTypeManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetListBuilder() : void {
    $entity = $this->prophesize(EntityTypeInterface::class);
    $entity->getHandlerClass('list_builder')
        ->willReturn(StubEntityHandlerBase::class);
    $this->setUpEntityTypeDefinitions([
        'test_entity_type' => $entity,
    ]);
    $this->assertInstanceOf(StubEntityHandlerBase::class, $this->entityTypeManager
        ->getListBuilder('test_entity_type'));
}

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