You are here

protected function SqlContentEntityStorageTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 97
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
    ->getMock('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->entityManager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->moduleHandler = $this
    ->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->cache = $this
    ->getMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->languageManager
    ->expects($this
    ->any())
    ->method('getDefaultLanguage')
    ->will($this
    ->returnValue(new Language(array(
    'langcode' => 'en',
  ))));
  $this->connection = $this
    ->getMockBuilder('Drupal\\Core\\Database\\Connection')
    ->disableOriginalConstructor()
    ->getMock();
}