public function EntityFieldManagerTest::testGetFieldMapFromCache in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Entity/EntityFieldManagerTest.php \Drupal\Tests\Core\Entity\EntityFieldManagerTest::testGetFieldMapFromCache()
@covers ::getFieldMap
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityFieldManagerTest.php, line 689 - Contains \Drupal\Tests\Core\Entity\EntityFieldManagerTest.
Class
- EntityFieldManagerTest
- @coversDefaultClass \Drupal\Core\Entity\EntityFieldManager @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testGetFieldMapFromCache() {
$expected = [
'test_entity_type' => [
'id' => [
'type' => 'integer',
'bundles' => [
'first_bundle' => 'first_bundle',
'second_bundle' => 'second_bundle',
],
],
'by_bundle' => [
'type' => 'string',
'bundles' => [
'second_bundle' => 'second_bundle',
],
],
],
];
$this
->setUpEntityTypeDefinitions();
$this->cacheBackend
->get('entity_field_map')
->willReturn((object) [
'data' => $expected,
]);
// Call the field map twice to make sure the static cache works.
$this
->assertEquals($expected, $this->entityFieldManager
->getFieldMap());
$this
->assertEquals($expected, $this->entityFieldManager
->getFieldMap());
}