You are here

public function EntityTypeTest::testSetLabelCallack in Drupal 8

@covers ::setLabelCallback

@group legacy

@deprecatedMessage EntityType::setLabelCallback() 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 552

Class

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

Namespace

Drupal\Tests\Core\Entity

Code

public function testSetLabelCallack() {
  $entity_type = $this
    ->setUpEntityType([]);
  $entity_type
    ->setLabelCallback('label_function');
  $this
    ->assertSame('label_function', $entity_type
    ->get('label_callback'));
}