function SqlContentEntityStorageTest::setUpEntityStorage

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest::setUpEntityStorage()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest::setUpEntityStorage()
  3. 10 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest::setUpEntityStorage()

Sets up the content entity database storage.

19 calls to SqlContentEntityStorageTest::setUpEntityStorage()
SqlContentEntityStorageTest::testCleanIds in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests entity ID sanitization.
SqlContentEntityStorageTest::testCreate in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
@covers ::create
SqlContentEntityStorageTest::testGetBaseTable in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests SqlContentEntityStorage::getBaseTable().
SqlContentEntityStorageTest::testGetDataTable in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests SqlContentEntityStorage::getDataTable().
SqlContentEntityStorageTest::testGetRevisionDataTable in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests SqlContentEntityStorage::getRevisionDataTable().

... See full list

File

core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php, line 1159

Class

SqlContentEntityStorageTest
@coversDefaultClass \Drupal\Core\Entity\Sql\SqlContentEntityStorage @group Entity

Namespace

Drupal\Tests\Core\Entity\Sql

Code

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

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