function EntityUnitTest::testLabel
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::testLabel()
- 10 core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::testLabel()
- 9 core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::testLabel()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php \Drupal\Tests\Core\Entity\EntityUnitTest::testLabel()
Tests label.
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUnitTest.php, line 197
Class
Namespace
Drupal\Tests\Core\EntityCode
public function testLabel() : void {
$this->setUpEntity(0, 1, 0);
$property_label = $this->randomMachineName();
$this->entityType
->expects($this->atLeastOnce())
->method('getKey')
->with('label')
->willReturn('label');
$this->entity->label = $property_label;
$this->assertSame($property_label, $this->entity
->label());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.