Tests a number field, with cardinality 1 and >1.
function testNumber() {
$field_name = 'field_nr';
$this
->createFieldWithInstance($field_name, 'number_integer', 1, 'Simple number field', array(), 'number', array(), 'number_integer', array());
// Pretend there is an entity with these items for the field.
$items = array(
42,
43,
);
// Editor selection with cardinality 1.
$this
->assertEqual('form', $this
->getSelectedEditor($items, $field_name), "With cardinality 1, the 'form' editor is selected.");
// Editor selection with cardinality >1.
$this->field_nr_field['cardinality'] = 2;
field_update_field($this->field_nr_field);
$this
->assertEqual('form', $this
->getSelectedEditor($items, $field_name), "With cardinality >1, the 'form' editor is selected.");
}