Tests the behavior of a field component within an EntityDisplay object.
public function testExtraFieldComponent() {
$display = entity_create('entity_display', array(
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
'mode' => 'default',
));
// Check that the default visibility taken into account for extra fields
// unknown in the display.
$this
->assertEqual($display
->getComponent('display_extra_field'), array(
'weight' => 5,
));
$this
->assertNull($display
->getComponent('display_extra_field_hidden'));
// Check that setting explicit options overrides the defaults.
$display
->removeComponent('display_extra_field');
$display
->setComponent('display_extra_field_hidden', array(
'weight' => 10,
));
$this
->assertNull($display
->getComponent('display_extra_field'));
$this
->assertEqual($display
->getComponent('display_extra_field_hidden'), array(
'weight' => 10,
));
}