You are here

protected function SqlContentEntityStorageTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest::setUp()

Overrides UnitTestCase::setUp

2 calls to SqlContentEntityStorageTest::setUp()
SqlContentEntityStorageTest::testGetTableMappingRevisionableTranslatableWithFields in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests getTableMapping() with a complex entity type with fields.
SqlContentEntityStorageTest::testGetTableMappingRevisionableWithFields in core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
Tests getTableMapping() with a revisionable entity type with fields.

File

core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php, line 117
Contains \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTest.

Class

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

Namespace

Drupal\Tests\Core\Entity\Sql

Code

protected function setUp() {
  $this->entityType = $this
    ->createMock('Drupal\\Core\\Entity\\ContentEntityTypeInterface');
  $this->entityType
    ->expects($this
    ->any())
    ->method('id')
    ->will($this
    ->returnValue($this->entityTypeId));
  $this->container = new ContainerBuilder();
  \Drupal::setContainer($this->container);
  $this->entityTypeManager = $this
    ->createMock(EntityTypeManager::class);
  $this->entityTypeBundleInfo = $this
    ->createMock(EntityTypeBundleInfoInterface::class);
  $this->entityFieldManager = $this
    ->createMock(EntityFieldManager::class);
  $this->moduleHandler = $this
    ->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->cache = $this
    ->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->languageManager = $this
    ->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->languageManager
    ->expects($this
    ->any())
    ->method('getDefaultLanguage')
    ->will($this
    ->returnValue(new Language([
    'langcode' => 'en',
  ])));
  $this->connection = $this
    ->getMockBuilder('Drupal\\Core\\Database\\Connection')
    ->disableOriginalConstructor()
    ->getMock();
  $this->container
    ->set('entity_type.manager', $this->entityTypeManager);
  $this->container
    ->set('entity_field.manager', $this->entityFieldManager);
}