Révision 5587145e
Ajouté par Assos Assos il y a presque 7 ans
drupal7/modules/contact/contact.test | ||
---|---|---|
346 | 346 |
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); |
347 | 347 |
$this->assertResponse(200); |
348 | 348 |
|
349 |
// Test that users can disable their contact form. |
|
350 |
$this->drupalLogin($this->contact_user); |
|
351 |
$edit = array('contact' => FALSE); |
|
352 |
$this->drupalPost('user/' . $this->contact_user->uid . '/edit', $edit, 'Save'); |
|
353 |
$this->drupalLogout(); |
|
354 |
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); |
|
355 |
$this->assertResponse(403); |
|
356 |
|
|
357 |
// Test that user's contact status stays disabled when saving. |
|
358 |
$contact_user_temp = user_load($this->contact_user->uid, TRUE); |
|
359 |
user_save($contact_user_temp); |
|
360 |
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); |
|
361 |
$this->assertResponse(403); |
|
362 |
|
|
363 |
// Test that users can enable their contact form. |
|
364 |
$this->drupalLogin($this->contact_user); |
|
365 |
$edit = array('contact' => TRUE); |
|
366 |
$this->drupalPost('user/' . $this->contact_user->uid . '/edit', $edit, 'Save'); |
|
367 |
$this->drupalLogout(); |
|
368 |
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); |
|
369 |
$this->assertResponse(200); |
|
370 |
|
|
349 | 371 |
// Revoke the personal contact permission for the anonymous user. |
350 | 372 |
user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms')); |
351 | 373 |
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); |
Formats disponibles : Unified diff
Update to 7.56