/** * @covers ::getFieldMap */ public function testGetFieldMapFromCache() { $expected = array('test_entity_type' => array('id' => array('type' => 'integer', 'bundles' => array('first_bundle', 'second_bundle')), 'by_bundle' => array('type' => 'string', 'bundles' => array('second_bundle')))); $this->setUpEntityManager(); $this->cacheBackend->expects($this->once())->method('get')->with('entity_field_map')->will($this->returnValue((object) array('data' => $expected))); // Call the field map twice to make sure the static cache works. $this->assertEquals($expected, $this->entityManager->getFieldMap()); $this->assertEquals($expected, $this->entityManager->getFieldMap()); }