diff options
Diffstat (limited to 'modules/field/modules/list/list.test')
-rw-r--r-- | modules/field/modules/list/list.test | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/field/modules/list/list.test b/modules/field/modules/list/list.test index a6c1ae1dc..5ed96a04f 100644 --- a/modules/field/modules/list/list.test +++ b/modules/field/modules/list/list.test @@ -42,28 +42,28 @@ class ListFieldTestCase extends DrupalWebTestCase { // All three options appear. $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][1]), t('Option 1 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][2]), t('Option 2 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][3]), t('Option 3 exists')); // Removed options do not appear. $this->card_1['settings']['allowed_values'] = "2|Two"; field_update_field($this->card_1); $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); + $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE][1]), t('Option 1 does not exist')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][2]), t('Option 2 exists')); + $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE][3]), t('Option 3 does not exist')); // Completely new options appear. $this->card_1['settings']['allowed_values'] = "10|Update\n20|Twenty"; field_update_field($this->card_1); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 does not exist')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 does not exist')); - $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 does not exist')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][10]), t('Option 10 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][20]), t('Option 20 exists')); + $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE][1]), t('Option 1 does not exist')); + $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE][2]), t('Option 2 does not exist')); + $this->assertTrue(empty($form['card_1'][FIELD_LANGUAGE_NONE][3]), t('Option 3 does not exist')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][10]), t('Option 10 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][20]), t('Option 20 exists')); // Options are reset when a new field with the same name is created. field_delete_field($this->card_1['field_name']); @@ -81,9 +81,9 @@ class ListFieldTestCase extends DrupalWebTestCase { $this->instance_1 = field_create_instance($this->instance_1); $entity = field_test_create_stub_entity(0, 0, FIELD_TEST_BUNDLE); $form = drupal_get_form('field_test_entity_form', $entity); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][1]), t('Option 1 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][2]), t('Option 2 exists')); - $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE]['value'][3]), t('Option 3 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][1]), t('Option 1 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][2]), t('Option 2 exists')); + $this->assertTrue(!empty($form['card_1'][FIELD_LANGUAGE_NONE][3]), t('Option 3 exists')); } } |