summaryrefslogtreecommitdiff
path: root/modules/field/tests
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2012-06-03 17:10:00 -0400
committerDavid Rothstein <drothstein@gmail.com>2012-06-03 17:10:00 -0400
commit84e34e4ad401b70d8602e06bfdb7124292eecc3d (patch)
tree05047c60bc371ffc60630d464d50c06fc4a135d2 /modules/field/tests
parentcdfde691a9573b59424ea19f7620f935a91c3ae8 (diff)
downloadbrdo-84e34e4ad401b70d8602e06bfdb7124292eecc3d.tar.gz
brdo-84e34e4ad401b70d8602e06bfdb7124292eecc3d.tar.bz2
Issue #822418 by catch, marcingy, davidjdagino, no_commit_credit, tim.plunkett, ezheidtmann: Fixed Field form structure incomplete if field_access() returns FALSE.
Diffstat (limited to 'modules/field/tests')
-rw-r--r--modules/field/tests/field.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index f7d9dddb2..0f7c41740 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -1650,6 +1650,18 @@ class FieldFormTestCase extends FieldTestCase {
$langcode = LANGUAGE_NONE;
+ // Test that the form structure includes full information for each delta
+ // apart from #access.
+ $entity_type = 'test_entity';
+ $entity = field_test_create_stub_entity(0, 0, $this->instance['bundle']);
+
+ $form = array();
+ $form_state = form_state_defaults();
+ field_attach_form($entity_type, $entity, $form, $form_state);
+
+ $this->assertEqual($form[$field_name_no_access][$langcode][0]['value']['#entity_type'], $entity_type, 'The correct entity type is set in the field structure.');
+ $this->assertFalse($form[$field_name_no_access]['#access'], 'Field #access is FALSE for the field without edit access.');
+
// Display creation form.
$this->drupalGet('test-entity/add/test-bundle');
$this->assertNoFieldByName("{$field_name_no_access}[$langcode][0][value]", '', t('Widget is not displayed if field access is denied.'));