function EntityTypeTest::testHasLabelCallack

@covers ::hasLabelCallback

@group legacy

@deprecatedMessage EntityType::hasLabelCallback() 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 565

Class

EntityTypeTest
@coversDefaultClass \Drupal\Core\Entity\EntityType[[api-linebreak]] @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testHasLabelCallack() {
  $entity_type = $this->setUpEntityType([
    'label_callback' => 'label_function',
  ]);
  $this->assertTrue($entity_type->hasLabelCallback());
  $entity_type = $this->setUpEntityType([]);
  $this->assertFalse($entity_type->hasLabelCallback());
}

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