function ContactAuthenticatedUserTest::testContactSiteWideTextfieldsLoggedInTestCase

Tests that name and email fields are not present for authenticated users.

File

drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactAuthenticatedUserTest.php, line 35
Definition of Drupal\contact\ContactAuthenticatedUserTest.

Class

ContactAuthenticatedUserTest
Tests the contact form for authenticated users.

Namespace

Drupal\contact\Tests

Code

function testContactSiteWideTextfieldsLoggedInTestCase() {
  $this
    ->drupalLogin($this
    ->drupalCreateUser(array(
    'access site-wide contact form',
  )));
  $this
    ->drupalGet('contact');

  // Ensure that there is no textfield for name.
  $this
    ->assertFalse($this
    ->xpath('//input[@name=:name]', array(
    ':name' => 'name',
  )));

  // Ensure that there is no textfield for email.
  $this
    ->assertFalse($this
    ->xpath('//input[@name=:name]', array(
    ':name' => 'mail',
  )));
}