diff --git a/core/modules/field/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module index c253852..0ec2daf 100644 --- a/core/modules/field/tests/modules/field_test/field_test.module +++ b/core/modules/field/tests/modules/field_test/field_test.module @@ -128,30 +128,23 @@ function field_test_query_efq_table_prefixing_test_alter(&$query) { $query->join('entity_test','et2','%alias.id = entity_test.id'); } - - /** +* Returns an arbitrary data just for test the callback. +* * Callback function for test the options_list_callback's setting * in the taxonomy_term_reference type field. * -* This function return an arbitrary data just for test the callback. -* * @param $field -* The field definition +* The field definition. * * @return array -* */ -function taxonomy_test_set_options_list($field) { +function field_test_taxonomy_options_list($field) { return array( - 'option_1' => t('Option 1') + 'option_1' => t('Option 1'), ); } - - - - /** * Implements hook_query_TAG_alter() for tag 'efq_metadata_test'. * diff --git a/core/modules/taxonomy/src/Tests/TermFieldTest.php b/core/modules/taxonomy/src/Tests/TermFieldTest.php index 67c6ee0..b635922 100644 --- a/core/modules/taxonomy/src/Tests/TermFieldTest.php +++ b/core/modules/taxonomy/src/Tests/TermFieldTest.php @@ -177,21 +177,20 @@ function testTaxonomyTermFieldChangeMachineName() { $this->assertEqual($allowed_values[2]['vocabulary'], 'foo', 'Index 2: Machine name was left untouched.'); } - /** - * Tests options_list_callback + * Tests options_list_callback. */ function testTaxonomyHookOptionsList() { - // Check the default behaviour + // Check the default behaviour. $term = $this->createTerm($this->vocabulary); $this->drupalGet('test-entity/add/test_bundle'); $this->assertFieldByXPath('//select/option', $term->tid, 'Correct value before to add the options_list_callback'); - // Check using a custom callback - $this->field['settings']['options_list_callback'] = 'taxonomy_test_set_options_list'; + // Check using a custom callback. + $this->field['settings']['options_list_callback'] = 'field_test_taxonomy_options_list'; field_update_field($this->field); $this->drupalGet('test-entity/add/test_bundle'); $this->assertFieldByXPath('//select/option', 'option_1', 'The options_list_callback was executed correctly'); } - + }