/** * @param string $entityClass * @return array */ public function getContactInformationFieldsInfo($entityClass) { if (!$entityClass) { return array(); } return $this->helper->getEntityContactInformationColumnsInfo($entityClass); }
public function testGetEntityContactInformationColumnsInfo() { $entity = '\\stdClass'; $columns = array($this->fields['one'], $this->fields['two'], $this->fields['three'], $this->fields['four']); $this->assertEntityMetadataCall($entity, $columns); $this->assertContactInformationConfig($entity); $fields = array(array('name' => $this->fields['one'], 'label' => 'One label'), array('name' => $this->fields['two'], 'label' => 'Two label'), array('name' => $this->fields['three'], 'label' => 'Three label'), array('name' => $this->fields['four'], 'label' => 'Four label')); $this->fieldProvider->expects($this->once())->method('getFields')->with($entity, false, true)->will($this->returnValue($fields)); $this->assertEquals(array(array('name' => $this->fields['one'], 'label' => 'One label', 'contact_information_type' => 'email'), array('name' => $this->fields['two'], 'label' => 'Two label', 'contact_information_type' => 'phone')), $this->helper->getEntityContactInformationColumnsInfo($entity)); }