You are here

protected function ConfigMapperManagerTest::getElement in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::getElement()
  2. 10 core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::getElement()

Returns a mocked schema element.

Parameters

array $definition: The definition of the schema element.

Return value

\Drupal\Core\Config\Schema\Element The mocked schema element.

1 call to ConfigMapperManagerTest::getElement()
ConfigMapperManagerTest::providerTestHasTranslatable in core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php
Provides data for ConfigMapperManager::testHasTranslatable()

File

core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php, line 149

Class

ConfigMapperManagerTest
Tests the functionality provided by configuration translation mapper manager.

Namespace

Drupal\Tests\config_translation\Unit

Code

protected function getElement(array $definition) {
  $data_definition = new DataDefinition($definition);
  $element = $this
    ->createMock('Drupal\\Core\\TypedData\\TypedDataInterface');
  $element
    ->expects($this
    ->any())
    ->method('getDataDefinition')
    ->will($this
    ->returnValue($data_definition));
  return $element;
}