function DefaultTableMappingTest::setUpDefinition
Sets up a field storage definition for the test.
Parameters
string $name: The field name.
array $column_names: An array of column names for the storage definition.
bool $base_field: Flag indicating whether the field should be treated as a base or bundle field.
Return value
\Drupal\Core\Field\FieldStorageDefinitionInterface|\PHPUnit\Framework\MockObject\MockObject
6 calls to DefaultTableMappingTest::setUpDefinition()
- DefaultTableMappingTest::testGetAllColumns in core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php  - Tests DefaultTableMapping::getAllColumns().
 - DefaultTableMappingTest::testGetColumnNames in core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php  - Tests DefaultTableMapping::getColumnNames().
 - DefaultTableMappingTest::testGetDedicatedTableName in core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php  - @covers ::getDedicatedDataTableName[[api-linebreak]] @covers ::getDedicatedRevisionTableName[[api-linebreak]]
 - DefaultTableMappingTest::testGetFieldColumnName in core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php  - Tests DefaultTableMapping::getFieldColumnName() with valid parameters.
 - DefaultTableMappingTest::testGetFieldColumnNameInvalid in core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php  - Tests DefaultTableMapping::getFieldColumnName() with invalid parameters.
 
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Entity/ Sql/ DefaultTableMappingTest.php, line 590  
Class
- DefaultTableMappingTest
 - @coversDefaultClass \Drupal\Core\Entity\Sql\DefaultTableMapping[[api-linebreak]] @group Entity
 
Namespace
Drupal\Tests\Core\Entity\SqlCode
protected function setUpDefinition($name, array $column_names, $base_field = TRUE) {
  $definition = $this->createMock('Drupal\\Tests\\Core\\Field\\TestBaseFieldDefinitionInterface');
  $definition->expects($this->any())
    ->method('isBaseField')
    ->willReturn($base_field);
  $definition->expects($this->any())
    ->method('getName')
    ->willReturn($name);
  $definition->expects($this->any())
    ->method('getColumns')
    ->willReturn(array_fill_keys($column_names, []));
  return $definition;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.