You are here

function CCKSelectOtherMultipleValueListTest::setUp in CCK Select Other 7

Same name and namespace in other branches
  1. 7.2 tests/cck_select_other.test \CCKSelectOtherMultipleValueListTest::setUp()

Implementation of setUp() method

Overrides CCKSelectOtherTest::setUp

File

tests/cck_select_other.test, line 464
test file for cck_select_other Testing file

Class

CCKSelectOtherMultipleValueListTest
@class CCK Select Other Multiple Value List Field Case Tests multiple value list fields where $delta > 1 or -1 (unlimited).

Code

function setUp() {
  parent::setUp();
  $this
    ->drupalLogin($this->admin_user);

  // Make changes to our field instance.
  $options_arr = array_keys(cck_select_other_options($this->test_instance));
  $edit = array(
    'field[cardinality]' => 2,
    $this->test_field['field_name'] . '[und][0][select_other_list]' => $options_arr[1],
  );
  $this
    ->drupalPost('admin/structure/types/manage/' . $this->test_node->type . '/fields/' . $this->test_field['field_name'], $edit, 'Save settings');
  field_cache_clear();

  // Ugh...
  // Load our field and instance back again.
  $this->test_field = field_info_field($this->test_field['field_name']);
  $this->test_instance = field_info_instance('node', $this->test_field['field_name'], $this->test_node->type);
  $this
    ->drupalLogout();
}