diff -u b/project_issue.module b/project_issue.module --- b/project_issue.module +++ b/project_issue.module @@ -2818,7 +2818,7 @@ // the search string. $args = func_get_args(); - // The first argument is $vid. Remove it. + // The first argument is $vid, which is not part of the search. Remove it. unset($args[0]); // If the menu system split the search into multiple arguments because '/' was only in patch2: unchanged: --- a/project_issue.info +++ b/project_issue.info @@ -39,6 +39,7 @@ files[] = tests/project_issue.test files[] = tests/integration/issue_creation.test files[] = tests/integration/maintainers.test files[] = tests/integration/issue_notifications.test +files[] = tests/integration/issue_autocomplete.test files[] = views/plugins/project_issue_table_plugin_style.inc files[] = views/plugins/project_issue_plugin_access_per_user_queue.inc only in patch2: unchanged: --- /dev/null +++ b/tests/integration/issue_autocomplete.test @@ -0,0 +1,59 @@ + 'Project issue autocomplete', + 'description' => 'Test field autocomplete modifications.', + 'group' => 'Project Issue', + ); + } + + protected function setUp() { + parent::setUp(array('project_issue')); + + $perms = array( + 'administer taxonomy', + 'administer content types', + ); + $this-> admin_user = $this->drupalCreateUser($perms); + $this->drupalLogin($this->admin_user); + } + + /** + * Test the autocomplete field modifications. + */ + function testProjectIssueAutocomplete() { + $vocabulary = new stdClass(); + $vocabulary->name = 'Autocomplete Test'; + $vocabulary->machine_name = 'project_issue_taxonomy_vocabulary_issue_queue_2'; + taxonomy_vocabulary_save($vocabulary); + variable_set('project_issue_taxonomy_vocabulary_issue_queue_2', 'autocomplete'); + $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary->machine_name); + // @todo Create terms that will illustrate the new ordering. + $terms = array('aa', 'bb', 'cc'); + foreach($terms as $term) { + $term_object = new stdClass(); + $term_object->name = $term; + $term_object->vid = $vocabulary->vid; + taxonomy_term_save($term_object); + } + $field = array( + 'field_name' => 'taxonomy_vocabulary_2', + 'type' => 'taxonomy_term_reference', + ); + field_create_field($field); + $this->drupalGet('admin/reports/fields'); + // @todo Add this field to a content type with an autocomplete widget. + // @todo Attach this field to a content type. + // @todo Tag some content with this field. + // @todo (maybe) clear the menu cache. + // @todo Send search terms to taxonomy/autocomplete/taxonomy_vocabulary_2 + // and check the order. + // @todo Test an invalid URL like + // taxonomy/autocomplete/taxonomy_vocabulary_foo and expect an error. + + } +}