You are here

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

@covers ::fetchDataByPropertyPath

File

tests/src/Kernel/DataFetcherTest.php, line 207

Class

DataFetcherTest
Class DataFetcherTest.

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
    ->fetchDataByPropertyPath($this->node
    ->getTypedData(), 'field_invalid.0.value')
    ->getValue();
}