Drupal 8  8.0.2
SqlContentEntityStorageTest Class Reference
Inheritance diagram for SqlContentEntityStorageTest:

Public Member Functions

 testGetBaseTable ($base_table, $expected)
 
 providerTestGetBaseTable ()
 
 testGetRevisionTable ($revision_table, $expected)
 
 providerTestGetRevisionTable ()
 
 testGetDataTable ()
 
 testGetRevisionDataTable ($revision_data_table, $expected)
 
 providerTestGetRevisionDataTable ()
 
 testOnEntityTypeCreate ()
 
 testGetTableMappingEmpty ()
 
 testGetTableMappingSimple (array $entity_keys)
 
 testGetTableMappingSimpleWithFields (array $entity_keys)
 
 providerTestGetTableMappingSimple ()
 
 testGetTableMappingRevisionable (array $entity_keys)
 
 testGetTableMappingRevisionableWithFields (array $entity_keys)
 
 testGetTableMappingTranslatable (array $entity_keys)
 
 testGetTableMappingTranslatableWithFields (array $entity_keys)
 
 testGetTableMappingRevisionableTranslatable (array $entity_keys)
 
 testGetTableMappingRevisionableTranslatableWithFields (array $entity_keys)
 
 testCreate ()
 
 testLoadMultiplePersistentCached ()
 
 testLoadMultipleNoPersistentCache ()
 
 testLoadMultiplePersistentCacheMiss ()
 
 testHasData ()
 
 testCleanIds ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 mockFieldDefinitions (array $field_names, $methods=array())
 
 setUpEntityStorage ()
 
 setUpModuleHandlerNoImplementations ()
 
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 
 getRandomGenerator ()
 
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 
 getBlockMockWithMachineName ($machine_name)
 
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 
 getClassResolverStub ()
 

Protected Attributes

 $entityStorage
 
 $entityType
 
 $fieldDefinitions = array()
 
 $entityManager
 
 $entityTypeId = 'entity_test'
 
 $container
 
 $moduleHandler
 
 $cache
 
 $languageManager
 
 $connection
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Entity

Member Function Documentation

mockFieldDefinitions ( array  $field_names,
  $methods = array() 
)
protected

Returns a set of mock field definitions for the given names.

Parameters
array$field_namesAn array of field names.
array$methods(optional) An associative array of mock method return values keyed by method name.
Returns
[]|[] An array of mock base field definitions.

Referenced by SqlContentEntityStorageTest\testCleanIds(), SqlContentEntityStorageTest\testGetTableMappingRevisionableTranslatableWithFields(), SqlContentEntityStorageTest\testGetTableMappingRevisionableWithFields(), SqlContentEntityStorageTest\testGetTableMappingSimpleWithFields(), SqlContentEntityStorageTest\testGetTableMappingTranslatableWithFields(), and SqlContentEntityStorageTest\testOnEntityTypeCreate().

Here is the caller graph for this function:

providerTestGetBaseTable ( )

Provides test data for testGetBaseTable().

Returns
array[] An nested array where each inner array has the base table to be returned by the mocked entity type as the first value and the expected return value of SqlContentEntityStorage::getBaseTable() as the second value.
providerTestGetRevisionDataTable ( )

Provides test data for testGetRevisionDataTable().

Returns
array[] An nested array where each inner array has the revision data table to be returned by the mocked entity type as the first value and the expected return value of SqlContentEntityStorage::getRevisionDataTable() as the second value.
providerTestGetRevisionTable ( )

Provides test data for testGetRevisionTable().

Returns
array[] An nested array where each inner array has the revision table to be returned by the mocked entity type as the first value and the expected return value of SqlContentEntityStorage::getRevisionTable() as the second value.
providerTestGetTableMappingSimple ( )

Provides test data for testGetTableMappingSimple().

Returns
array[] A nested array, where each inner array has a single value being a map of entity keys to use for the mocked entity type.
setUp ( )
protected

{}

References Drupal\cache(), Drupal\entityManager(), Drupal\languageManager(), Drupal\moduleHandler(), and Drupal\setContainer().

Referenced by SqlContentEntityStorageTest\testGetTableMappingRevisionableTranslatableWithFields(), and SqlContentEntityStorageTest\testGetTableMappingRevisionableWithFields().

Here is the call graph for this function:

Here is the caller graph for this function:

setUpModuleHandlerNoImplementations ( )
protected

Sets up the module handler with no implementations.

References Drupal\moduleHandler().

Referenced by SqlContentEntityStorageTest\testLoadMultipleNoPersistentCache(), SqlContentEntityStorageTest\testLoadMultiplePersistentCached(), and SqlContentEntityStorageTest\testLoadMultiplePersistentCacheMiss().

Here is the call graph for this function:

Here is the caller graph for this function:

testCleanIds ( )

Tests entity ID sanitization.

References SqlContentEntityStorageTest\mockFieldDefinitions(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testCreate ( )

::create

References Drupal\entityManager(), Drupal\moduleHandler(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetBaseTable (   $base_table,
  $expected 
)

Tests SqlContentEntityStorage::getBaseTable().

Parameters
string$base_tableThe base table to be returned by the mocked entity type.
string$expectedThe expected return value of SqlContentEntityStorage::getBaseTable().

::__construct ::getBaseTable

providerTestGetBaseTable

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetDataTable ( )

Tests SqlContentEntityStorage::getDataTable().

::__construct ::getDataTable

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetRevisionDataTable (   $revision_data_table,
  $expected 
)

Tests SqlContentEntityStorage::getRevisionDataTable().

Parameters
string$revision_data_tableThe revision data table to be returned by the mocked entity type.
string$expectedThe expected return value of SqlContentEntityStorage::getRevisionDataTable().

::__construct ::getRevisionDataTable

providerTestGetRevisionDataTable

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetRevisionTable (   $revision_table,
  $expected 
)

Tests SqlContentEntityStorage::getRevisionTable().

Parameters
string$revision_tableThe revision table to be returned by the mocked entity type.
string$expectedThe expected return value of SqlContentEntityStorage::getRevisionTable().

::__construct ::getRevisionTable

providerTestGetRevisionTable

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingEmpty ( )

Tests getTableMapping() with an empty entity type.

::__construct ::getTableMapping

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingRevisionable ( array  $entity_keys)

Tests getTableMapping() with a revisionable, non-translatable entity type.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingRevisionableTranslatable ( array  $entity_keys)

Tests getTableMapping() with a revisionable, translatable entity type.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingRevisionableTranslatableWithFields ( array  $entity_keys)

Tests getTableMapping() with a complex entity type with fields.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\mockFieldDefinitions(), SqlContentEntityStorageTest\setUp(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingRevisionableWithFields ( array  $entity_keys)

Tests getTableMapping() with a revisionable entity type with fields.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\mockFieldDefinitions(), SqlContentEntityStorageTest\setUp(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingSimple ( array  $entity_keys)

Tests getTableMapping() with a simple entity type.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingSimpleWithFields ( array  $entity_keys)

Tests getTableMapping() with a simple entity type with some base fields.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\mockFieldDefinitions(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingTranslatable ( array  $entity_keys)

Tests getTableMapping() with a non-revisionable, translatable entity type.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testGetTableMappingTranslatableWithFields ( array  $entity_keys)

Tests getTableMapping() with a translatable entity type with fields.

Parameters
string[]$entity_keys A map of entity keys to use for the mocked entity type.

::__construct ::getTableMapping

providerTestGetTableMappingSimple()

References SqlContentEntityStorageTest\mockFieldDefinitions(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:

testHasData ( )

::hasData

References Drupal\cache(), Drupal\entityManager(), and Drupal\languageManager().

Here is the call graph for this function:

testLoadMultipleNoPersistentCache ( )

::doLoadMultiple ::buildCacheId ::getFromPersistentCache ::setPersistentCache

References Drupal\cache(), Drupal\entityManager(), Drupal\languageManager(), and SqlContentEntityStorageTest\setUpModuleHandlerNoImplementations().

Here is the call graph for this function:

testLoadMultiplePersistentCached ( )

::doLoadMultiple ::buildCacheId ::getFromPersistentCache

References Drupal\cache(), SqlContentEntityStorageTest\setUpEntityStorage(), and SqlContentEntityStorageTest\setUpModuleHandlerNoImplementations().

Here is the call graph for this function:

testLoadMultiplePersistentCacheMiss ( )

::doLoadMultiple ::buildCacheId ::getFromPersistentCache ::setPersistentCache

References Drupal\cache(), CacheBackendInterface\CACHE_PERMANENT, Drupal\entityManager(), Drupal\languageManager(), and SqlContentEntityStorageTest\setUpModuleHandlerNoImplementations().

Here is the call graph for this function:

testOnEntityTypeCreate ( )

Tests ContentEntityDatabaseStorage::onEntityTypeCreate().

::__construct ::onEntityTypeCreate ::getTableMapping

References Drupal\cache(), Drupal\entityManager(), Drupal\languageManager(), SqlContentEntityStorageTest\mockFieldDefinitions(), and SqlContentEntityStorageTest\setUpEntityStorage().

Here is the call graph for this function:


The documentation for this class was generated from the following file: