Révision 08f5d39b
Ajouté par Assos Assos il y a environ 9 ans
drupal7/modules/profile/profile.test | ||
---|---|---|
339 | 339 |
$this->setProfileField($field, $field['value']); |
340 | 340 |
|
341 | 341 |
// Set some html for what we want to see in the page output later. |
342 |
$autocomplete_html = '<input type="hidden" id="' . drupal_html_id('edit-' . $field['form_name'] . '-autocomplete') . '" value="' . url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE)) . '" disabled="disabled" class="autocomplete" />'; |
|
343 |
$field_html = '<input type="text" maxlength="255" name="' . $field['form_name'] . '" id="' . drupal_html_id('edit-' . $field['form_name']) . '" size="60" value="' . $field['value'] . '" class="form-text form-autocomplete required" />'; |
|
342 |
// Autocomplete always uses non-clean URLs. |
|
343 |
$current_clean_url = isset($GLOBALS['conf']['clean_url']) ? $GLOBALS['conf']['clean_url'] : NULL; |
|
344 |
$GLOBALS['conf']['clean_url'] = 0; |
|
345 |
$autocomplete_url = url('profile/autocomplete/' . $field['fid'], array('absolute' => TRUE)); |
|
346 |
$GLOBALS['conf']['clean_url'] = $current_clean_url; |
|
347 |
$autocomplete_id = drupal_html_id('edit-' . $field['form_name'] . '-autocomplete'); |
|
348 |
$autocomplete_html = '<input type="hidden" id="' . $autocomplete_id . '" value="' . $autocomplete_url . '" disabled="disabled" class="autocomplete" />'; |
|
344 | 349 |
|
345 | 350 |
// Check that autocompletion html is found on the user's profile edit page. |
346 | 351 |
$this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category); |
347 | 352 |
$this->assertRaw($autocomplete_html, 'Autocomplete found.'); |
353 |
$this->assertFieldByXPath( |
|
354 |
'//input[@type="text" and @name="' . $field['form_name'] . '" and contains(@class, "form-autocomplete")]', |
|
355 |
'', |
|
356 |
'Text input field found' |
|
357 |
); |
|
348 | 358 |
$this->assertRaw('misc/autocomplete.js', 'Autocomplete JavaScript found.'); |
349 | 359 |
$this->assertRaw('class="form-text form-autocomplete"', 'Autocomplete form element class found.'); |
350 | 360 |
|
Formats disponibles : Unified diff
Update drupal 7.38 -> 7.39