name = isset($extra['name']) ? $extra['name'] : 'test_profile'; $profile->admin_title = isset($extra['admin_title']) ? $extra['admin_title'] : 'Test Profile'; $profile->admin_description = isset($extra['admin_description']) ? $extra['admin_description'] : 'This is a description for the Test Profile.'; $profile->data = array(); if (isset($extra['data'])) { $profile->data += $extra['data']; } if (empty($profile->data['profile_type'])) { $profile->profile_type = LINKIT_PROFILE_TYPE_EDITOR; } if (!isset($profile->data['insert_plugin']) && $profile->profile_type == LINKIT_PROFILE_TYPE_FIELD) { $profile->data['insert_plugin'] = array( 'plugin' => 'raw_url', 'url_method' => LINKIT_URL_METHOD_RAW, ); } // Save the profile. ctools_export_crud_save('linkit_profiles', $profile); // Load and return the saved profile. $this->_profile = linkit_profile_load($profile->name); } /** * Helper function: Update a Linkit profile. */ protected function updateProfile() { ctools_include('export'); // Save the changes to the profile. ctools_export_crud_save('linkit_profiles', $this->_profile); // Load the saved profile. $this->_profile = linkit_profile_load($this->_profile->name); } /** * Helper method to process the autocomplete call. */ protected function autocompleteCall() { // Call the autocomplete. $path = 'linkit/autocomplete/' . $this->_profile->name; $response = $this->drupalGetAJAX($path, array('query' => array(LINKIT_BAC_QUERY_KEY => $this->search_string))); $this->assertResponse(200); $this->assertNotNull($response, 'The JSON respone is seems to be ok.'); return $response; } }