@todo.
Overrides FieldTestBase::setUp
protected function setUp() {
parent::setUp();
// Setup basic fields.
$this
->setUpFields(3);
// Setup a field with cardinality > 1.
$this->fields[3] = $field = field_create_field(array(
'field_name' => 'field_name_3',
'type' => 'text',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
));
// Setup a field that will have no value.
$this->fields[4] = $field = field_create_field(array(
'field_name' => 'field_name_4',
'type' => 'text',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
));
$this
->setUpInstances();
// Create some nodes.
$this->nodes = array();
for ($i = 0; $i < 3; $i++) {
$edit = array(
'type' => 'page',
);
for ($key = 0; $key < 3; $key++) {
$field = $this->fields[$key];
$edit[$field['field_name']][0]['value'] = $this
->randomName(8);
}
for ($j = 0; $j < 5; $j++) {
$edit[$this->fields[3]['field_name']][$j]['value'] = $this
->randomName(8);
}
// Set this field to be empty.
$edit[$this->fields[4]['field_name']] = array(
array(
'value' => NULL,
),
);
$this->nodes[$i] = $this
->drupalCreateNode($edit);
}
$this->container
->get('views.views_data')
->clear();
}