function EntityStorageDeprecationTest::testSetEntityClass

Tests the deprecation when setting entityClass directly.

@group legacy

File

core/tests/Drupal/Tests/Core/Entity/EntityStorageDeprecationTest.php, line 185

Class

EntityStorageDeprecationTest
@coversDefaultClass \Drupal\Core\Entity\EntityStorageBase @group Entity @group legacy

Namespace

Drupal\Tests\Core\Entity

Code

public function testSetEntityClass() : void {
    $this->setUpEntityStorage();
    $this->expectDeprecation('Setting the entityClass property directly is deprecated in drupal:9.3.0 and has no effect in drupal:10.0.0. See https://www.drupal.org/node/3191609');
    $this->entityStorage
        ->setEntityClass('entity_class');
    $this->assertEquals('entity_class', $this->entityStorage
        ->getEntityClass());
}

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