Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / Form / EmailTest.php
similarity index 73%
rename from web/core/modules/system/src/Tests/Form/EmailTest.php
rename to web/core/modules/system/tests/src/Functional/Form/EmailTest.php
index a9d445d63323f7e3a8b7755c66f47225ecf88e5b..2fe6ebe9078f2598d9813e418383d4648a927b9b 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 
-namespace Drupal\system\Tests\Form;
+namespace Drupal\Tests\system\Functional\Form;
 
 use Drupal\Component\Serialization\Json;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests the form API email element.
  *
  * @group Form
  */
-class EmailTest extends WebTestBase {
+class EmailTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -19,8 +19,6 @@ class EmailTest extends WebTestBase {
    */
   public static $modules = ['form_test'];
 
-  protected $profile = 'testing';
-
   /**
    * Tests that #type 'email' fields are properly validated.
    */
@@ -34,14 +32,16 @@ class EmailTest extends WebTestBase {
 
     $edit = [];
     $edit['email_required'] = '  foo.bar@example.com ';
-    $values = Json::decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
+    $this->drupalPostForm('form-test/email', $edit, 'Submit');
+    $values = Json::decode($this->getSession()->getPage()->getContent());
     $this->assertIdentical($values['email'], '');
     $this->assertEqual($values['email_required'], 'foo.bar@example.com');
 
     $edit = [];
     $edit['email'] = 'foo@example.com';
     $edit['email_required'] = 'example@drupal.org';
-    $values = Json::decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
+    $this->drupalPostForm('form-test/email', $edit, 'Submit');
+    $values = Json::decode($this->getSession()->getPage()->getContent());
     $this->assertEqual($values['email'], 'foo@example.com');
     $this->assertEqual($values['email_required'], 'example@drupal.org');
   }