public function EntityAdapterUnitTest::testToArray in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php \Drupal\Tests\Core\Entity\TypedData\EntityAdapterUnitTest::testToArray()
- 9 core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php \Drupal\Tests\Core\Entity\TypedData\EntityAdapterUnitTest::testToArray()
@covers ::toArray
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ TypedData/ EntityAdapterUnitTest.php, line 347
Class
- EntityAdapterUnitTest
- @coversDefaultClass \Drupal\Core\Entity\Plugin\DataType\EntityAdapter @group Entity @group TypedData
Namespace
Drupal\Tests\Core\Entity\TypedDataCode
public function testToArray() {
$array = $this->entityAdapter
->toArray();
// Mock field objects return NULL values, so test keys only.
$this
->assertArrayHasKey('id', $array);
$this
->assertArrayHasKey('revision_id', $array);
$this
->assertCount(2, $array);
}