function EntityStorageDeprecationTest::testGetEntityClass
Tests the deprecation when accessing entityClass directly.
@group legacy
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityStorageDeprecationTest.php, line 173
Class
- EntityStorageDeprecationTest
- @coversDefaultClass \Drupal\Core\Entity\EntityStorageBase @group Entity @group legacy
Namespace
Drupal\Tests\Core\EntityCode
public function testGetEntityClass() : void {
$this->setUpEntityStorage();
$this->expectDeprecation('Accessing the entityClass property directly is deprecated in drupal:9.3.0. Use ::getEntityClass() instead. See https://www.drupal.org/node/3191609');
$entity_class = $this->entityStorage
->getCurrentEntityClass();
$this->assertEquals('bogus_class', $entity_class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.