public function DataDefinitionFetcherTest::testFetchingNonComplexType in Typed Data API enhancements 8
@covers ::fetchDefinitionByPropertyPath
File
- tests/
src/ Kernel/ DataDefinitionFetcherTest.php, line 227
Class
- DataDefinitionFetcherTest
- Tests that data fetcher definition fetching functions work correctly.
Namespace
Drupal\Tests\typed_data\KernelCode
public function testFetchingNonComplexType() {
$this
->expectException(InvalidArgumentException::class);
$this
->expectExceptionMessage("The data selector 'field_integer.0.value.not_existing' cannot be applied because the parent property 'value' is not a list or a complex structure");
// This should trigger an exception.
$this->dataFetcher
->fetchDefinitionByPropertyPath($this->nodeDefinition, 'field_integer.0.value.not_existing');
}