You are here

public function BundleInherit::fieldInstanceCreate in Bundle Inherit 7

1 call to BundleInherit::fieldInstanceCreate()
BundleInherit::testCRUD in ./bundle_inherit.test
Run complex CRUD test based on node entity type.

File

./bundle_inherit.test, line 77
Tests for bundle_inherit module.

Class

BundleInherit
@file Tests for bundle_inherit module.

Code

public function fieldInstanceCreate() {
  field_create_instance(array(
    'field_name' => $this->extraField['field']['field_name'],
    'entity_type' => 'node',
    'bundle' => $this->parentType->type,
  ));
  $this->extraField['instance'] = field_info_instance('node', $this->extraField['field']['field_name'], $this->parentType->type);
  $parent_type_field_instance = $this->extraField['instance'];
  $child_type_field_instance = field_info_instance('node', $this->extraField['field']['field_name'], $this->childType->type);
  $this
    ->assertTrue($this
    ->compareInstances($parent_type_field_instance, $child_type_field_instance), t('The field instance attached to the parent type was succesfuly attached to the child type and equal to the parent one.'));
}