You are here

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

@covers ::fetchDataByPropertyPath

File

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

Class

DataFetcherTest
Class DataFetcherTest.

Namespace

Drupal\Tests\typed_data\Kernel

Code

public function testFetchingEmptyProperty() {
  $this->node->field_integer
    ->setValue([]);
  $fetched_value = $this->dataFetcher
    ->fetchDataByPropertyPath($this->node
    ->getTypedData(), 'field_integer')
    ->getValue();
  $this
    ->assertEquals($fetched_value, []);
}