function EntityTypeTest::testGetLabelCallack
@covers ::getLabelCallback
@group legacy
@deprecatedMessage EntityType::getLabelCallback() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Override the EntityInterface::label() method instead for dynamic labels. See https://www.drupal.org/node/3050794
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeTest.php, line 537
Class
- EntityTypeTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityType.php/class/EntityType/8.9.x" title="Provides an implementation of an entity type and its metadata." class="local">\Drupal\Core\Entity\EntityType</a> @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testGetLabelCallack() {
$entity_type = $this->setUpEntityType([
'label_callback' => 'label_function',
]);
$this->assertSame('label_function', $entity_type->getLabelCallback());
$entity_type = $this->setUpEntityType([]);
$this->assertNull($entity_type->getLabelCallback());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.