3 namespace Drupal\Tests\contact\Functional;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests contact form textfields are present if authenticated.
12 class ContactAuthenticatedUserTest extends BrowserTestBase {
19 public static $modules = ['contact'];
22 * Tests that name and email fields are not present for authenticated users.
24 public function testContactSiteWideTextfieldsLoggedInTestCase() {
25 $this->drupalLogin($this->drupalCreateUser(['access site-wide contact form']));
26 $this->drupalGet('contact');
28 // Ensure that there is no textfield for name.
29 $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'name']));
31 // Ensure that there is no textfield for email.
32 $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'mail']));