public function EntityAdapterUnitTest::testToArray in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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 334 - Contains \Drupal\Tests\Core\Entity\TypedData\EntityAdapterUnitTest.
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
->assertEquals(count($array), 2);
}