function EntityFieldManagerTest::testGetFieldMapFromCache
@covers ::getFieldMap
      
    
File
- 
              core/tests/ Drupal/ Tests/ Core/ Entity/ EntityFieldManagerTest.php, line 780 
Class
- EntityFieldManagerTest
- @coversDefaultClass \Drupal\Core\Entity\EntityFieldManager[[api-linebreak]] @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());
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
