function ConfigMapperManagerTest::getElement

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. 8.9.x core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::getElement()
  3. 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 158

Class

ConfigMapperManagerTest
Tests the functionality provided by configuration translation mapper manager.

Namespace

Drupal\Tests\config_translation\Unit

Code

protected static function getElement(array $definition) {
    $data_definition = new DataDefinition($definition);
    $element = (new Prophet())->prophesize(TypedDataInterface::class);
    $element->getDataDefinition()
        ->willReturn($data_definition);
    return $element->reveal();
}

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