You are here

function FieldMultipleLimitTestCase::testFieldInfo in Field multiple limit 7

Test that custom info settings are set and retained.

File

./field_multiple_limit.test, line 82
Tests for Field Multiple Limit, based on examples from field.test

Class

FieldMultipleLimitTestCase
Test the field formatter settings work.

Code

function testFieldInfo() {

  // Load the field instance, set it multiple, original order and save.
  $instance = field_read_instance($this->entity_type, $this->instance_definition['field_name'], $this->instance_definition['bundle']);
  $instance['display']['default']['settings']['field_multiple_limit'] = 3;
  $instance['display']['default']['settings']['field_multiple_limit_order'] = 0;
  field_update_instance($instance);

  // Reload it, and check that the value was remembered.
  $instance = field_read_instance($this->entity_type, $this->field_name, $this->bundle);
  $field_multiple_limit = $instance['display']['default']['settings']['field_multiple_limit'];
  $field_multiple_limit_order = $instance['display']['default']['settings']['field_multiple_limit_order'];
  $this
    ->assertEqual($field_multiple_limit, 3, 'Saving the field_multiple_limit value on a field instance widget was remembered.');
  $this
    ->assertEqual($field_multiple_limit_order, 0, 'Saving the field_multiple_limit_order value on a field instance widget was remembered.');
}