function EntityStorageDeprecationTest::setUpEntityStorage

Sets up the content entity storage.

2 calls to EntityStorageDeprecationTest::setUpEntityStorage()
EntityStorageDeprecationTest::testGetEntityClass in core/tests/Drupal/Tests/Core/Entity/EntityStorageDeprecationTest.php
Tests the deprecation when accessing entityClass directly.
EntityStorageDeprecationTest::testSetEntityClass in core/tests/Drupal/Tests/Core/Entity/EntityStorageDeprecationTest.php
Tests the deprecation when setting entityClass directly.

File

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

Class

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

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUpEntityStorage() {
    $this->connection = $this->getMockBuilder('Drupal\\Core\\Database\\Connection')
        ->disableOriginalConstructor()
        ->getMock();
    $this->entityTypeManager
        ->expects($this->any())
        ->method('getDefinition')
        ->willReturn($this->entityType);
    $this->entityTypeManager
        ->expects($this->any())
        ->method('getActiveDefinition')
        ->willReturn($this->entityType);
    $this->entityFieldManager
        ->expects($this->any())
        ->method('getFieldStorageDefinitions')
        ->willReturn($this->fieldDefinitions);
    $this->entityFieldManager
        ->expects($this->any())
        ->method('getActiveFieldStorageDefinitions')
        ->willReturn($this->fieldDefinitions);
    $this->entityStorage = new DeprecatedEntityStorage($this->entityType, $this->connection, $this->entityFieldManager, $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager);
    $this->entityStorage
        ->setModuleHandler($this->moduleHandler);
}

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