You are here

public function DataDefinitionFetcherTest::testFetchingInvalidProperty in Typed Data API enhancements 8

@covers ::fetchDefinitionByPropertyPath

File

tests/src/Kernel/DataDefinitionFetcherTest.php, line 184

Class

DataDefinitionFetcherTest
Tests that data fetcher definition fetching functions work correctly.

Namespace

Drupal\Tests\typed_data\Kernel

Code

public function testFetchingInvalidProperty() {
  $this
    ->expectException(InvalidArgumentException::class);
  $this
    ->expectExceptionMessage("Unable to apply data selector 'field_invalid.0.value' at 'field_invalid'");

  // This should trigger an exception.
  $this->dataFetcher
    ->fetchDefinitionByPropertyPath($this->nodeDefinition, 'field_invalid.0.value');
}