You are here

protected function ConfigMapperManagerTest::getElement in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::getElement()
  2. 9 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.

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;
}