public function DataDefinitionFetcherTest::testFetchingAcrossReferences in Typed Data API enhancements 8
@covers ::fetchDefinitionByPropertyPath
File
- tests/
src/ Kernel/ DataDefinitionFetcherTest.php, line 139
Class
- DataDefinitionFetcherTest
- Tests that data fetcher definition fetching functions work correctly.
Namespace
Drupal\Tests\typed_data\KernelCode
public function testFetchingAcrossReferences() {
$target_definition = $this->nodeDefinition
->getPropertyDefinition('uid')
->getItemDefinition()
->getPropertyDefinition('entity')
->getTargetDefinition()
->getPropertyDefinition('name')
->getItemDefinition()
->getPropertyDefinition('value');
$fetched_definition = $this->dataFetcher
->fetchDefinitionByPropertyPath($this->nodeDefinition, 'uid.entity.name.value');
$this
->assertSame($target_definition, $fetched_definition);
}