function EntityTypeTest::testEntityClassImplements

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

@covers ::entityClassImplements

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php, line 499

Class

EntityTypeTest
@coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testEntityClassImplements() : void {
    $entity_type = $this->setUpEntityType([
        'class' => EntityFormMode::class,
    ]);
    $this->assertTrue($entity_type->entityClassImplements(ConfigEntityInterface::class));
    $this->assertFalse($entity_type->entityClassImplements(\DateTimeInterface::class));
}

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