db backup prior to drupal security update
[yaffs-website] / web / core / modules / contact / tests / src / Functional / ContactAuthenticatedUserTest.php
1 <?php
2
3 namespace Drupal\Tests\contact\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests contact form textfields are present if authenticated.
9  *
10  * @group contact
11  */
12 class ContactAuthenticatedUserTest extends BrowserTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['contact'];
20
21   /**
22    * Tests that name and email fields are not present for authenticated users.
23    */
24   public function testContactSiteWideTextfieldsLoggedInTestCase() {
25     $this->drupalLogin($this->drupalCreateUser(['access site-wide contact form']));
26     $this->drupalGet('contact');
27
28     // Ensure that there is no textfield for name.
29     $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'name']));
30
31     // Ensure that there is no textfield for email.
32     $this->assertFalse($this->xpath('//input[@name=:name]', [':name' => 'mail']));
33   }
34
35 }