function TypedDataTest::createTypedData
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php \Drupal\KernelTests\Core\TypedData\TypedDataTest::createTypedData()
- 8.9.x core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php \Drupal\KernelTests\Core\TypedData\TypedDataTest::createTypedData()
- 11.x core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php \Drupal\KernelTests\Core\TypedData\TypedDataTest::createTypedData()
Creates a typed data object and ensures it implements TypedDataInterface.
See also
\Drupal\Core\TypedData\TypedDataManager::create()
4 calls to TypedDataTest::createTypedData()
- TypedDataTest::testGetAndSet in core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php - Tests the basics around constructing and working with typed data objects.
- TypedDataTest::testTypedDataLists in core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php - Tests using typed data lists.
- TypedDataTest::testTypedDataListsFilter in core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php - Tests the filter() method on typed data lists.
- TypedDataTest::testTypedDataMaps in core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php - Tests using a typed data map.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ TypedData/ TypedDataTest.php, line 61
Class
- TypedDataTest
- Tests the functionality of all core data types.
Namespace
Drupal\KernelTests\Core\TypedDataCode
protected function createTypedData($definition, $value = NULL, $name = NULL) {
if (is_array($definition)) {
$definition = DataDefinition::create($definition['type']);
}
$data = $this->typedDataManager
->create($definition, $value, $name);
$this->assertInstanceOf(TypedDataInterface::class, $data);
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.