public function DataFetcherTest::testFetchingEntityReference in Typed Data API enhancements 8
@covers ::fetchDataByPropertyPath
File
- tests/
src/ Kernel/ DataFetcherTest.php, line 132
Class
- DataFetcherTest
- Class DataFetcherTest.
Namespace
Drupal\Tests\typed_data\KernelCode
public function testFetchingEntityReference() {
$user = $this->entityTypeManager
->getStorage('user')
->create([
'name' => 'test',
'type' => 'user',
]);
$this->node->uid->entity = $user;
$fetched_user = $this->dataFetcher
->fetchDataByPropertyPath($this->node
->getTypedData(), 'uid.entity')
->getValue();
$this
->assertSame($fetched_user, $user);
}