.../lib/Drupal/field/Tests/FieldAttachOtherTest.php | 8 ++++---- .../lib/Drupal/field/Tests/FieldAttachTestBase.php | 15 ++++++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php index 0d04e8f..d61c2ad 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php @@ -25,7 +25,7 @@ public static function getInfo() { * Test field_attach_view() and field_attach_prepare_view(). */ function testFieldAttachView() { - $this->createFieldInstance(' 2', '_2'); + $this->createFieldInstance('_2'); $entity_type = 'test_entity'; $entity_init = field_test_create_entity(); @@ -328,7 +328,7 @@ function testFieldAttachCache() { * hook_field_validate. */ function testFieldAttachValidate() { - $this->createFieldInstance(' 2', '_2'); + $this->createFieldInstance('_2'); $entity_type = 'test_entity'; $entity = field_test_create_entity(0, 0, $this->instance['bundle']); @@ -420,7 +420,7 @@ function testFieldAttachValidate() { * widgets show up. */ function testFieldAttachForm() { - $this->createFieldInstance(' 2', '_2'); + $this->createFieldInstance('_2'); $entity_type = 'test_entity'; $entity = field_test_create_entity(0, 0, $this->instance['bundle']); @@ -460,7 +460,7 @@ function testFieldAttachForm() { * Test field_attach_submit(). */ function testFieldAttachSubmit() { - $this->createFieldInstance(' 2', '_2'); + $this->createFieldInstance('_2'); $entity_type = 'test_entity'; $entity_init = field_test_create_entity(0, 0, $this->instance['bundle']); diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php index e25f721..59a81bf 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachTestBase.php @@ -19,20 +19,17 @@ function setUp() { parent::setUp(); - $this->createFieldInstance(' 1'); + $this->createFieldInstance(); } /** * Create a field instance. * - * @param string $label_suffix - * A suffix that will be used to uniquely identify this field instance in - * all user-visible string references to it. * @param string $suffix * (optional) A string that should only contain characters that are valid in - * PHP variable names as well. The details for this field + * PHP variable names as well. */ - function createFieldInstance($label_suffix, $suffix = '') { + function createFieldInstance($suffix = '') { $field_name = 'field_name' . $suffix; $field = 'field' . $suffix; $field_id = 'field_id' . $suffix; @@ -46,15 +43,15 @@ function createFieldInstance($label_suffix, $suffix = '') { 'field_name' => $this->$field_name, 'entity_type' => 'test_entity', 'bundle' => 'test_bundle', - 'label' => $this->randomName() . '_label' . $label_suffix, - 'description' => $this->randomName() . '_description' . $label_suffix, + 'label' => $this->randomName() . '_label', + 'description' => $this->randomName() . '_description', 'weight' => mt_rand(0, 127), 'settings' => array( 'test_instance_setting' => $this->randomName(), ), 'widget' => array( 'type' => 'test_field_widget', - 'label' => 'Test Field' . $label_suffix, + 'label' => 'Test Field', 'settings' => array( 'test_widget_setting' => $this->randomName(), )