function SqlContentEntityStorageSchemaTest::setUp

Same name in this branch
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\KernelTests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\KernelTests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
  3. 10 core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\KernelTests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
  4. 10 core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
  5. 11.x core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\KernelTests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()
  6. 11.x core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php \Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageSchemaTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php, line 79

Class

SqlContentEntityStorageSchemaTest
@coversDefaultClass \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema @group Entity

Namespace

Drupal\Tests\Core\Entity\Sql

Code

protected function setUp() {
    $this->entityTypeManager = $this->createMock(EntityTypeManager::class);
    $this->entityFieldManager = $this->createMock(EntityFieldManager::class);
    $this->entityLastInstalledSchemaRepository = $this->createMock(EntityLastInstalledSchemaRepositoryInterface::class);
    $this->storage = $this->getMockBuilder('Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorage')
        ->disableOriginalConstructor()
        ->getMock();
    $this->storage
        ->expects($this->any())
        ->method('getBaseTable')
        ->will($this->returnValue('entity_test'));
    // Add an ID field. This also acts as a test for a simple, single-column
    // field.
    $this->setUpStorageDefinition('id', [
        'columns' => [
            'value' => [
                'type' => 'int',
            ],
        ],
    ]);
}

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