function ConfigMapperManagerTest::getElement

Same name and namespace in other branches
  1. 8.9.x 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()
  3. 11.x 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 152

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')
        ->willReturn($data_definition);
    return $element;
}

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