diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 293f25a..9b3f31e 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -59,6 +59,8 @@
  * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
  *   Use Drupal\Core\Session\AccountInterface::ANONYMOUS_ROLE or
  *   \Drupal\user\RoleInterface::ANONYMOUS_ID instead.
+ *
+ * @see https://www.drupal.org/node/1619504
  */
 const DRUPAL_ANONYMOUS_RID = AccountInterface::ANONYMOUS_ROLE;
 
@@ -68,6 +70,8 @@
  * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
  *   Use Drupal\Core\Session\AccountInterface::AUTHENTICATED_ROLE or
  *   \Drupal\user\RoleInterface::AUTHENTICATED_ID instead.
+ *
+ * @see https://www.drupal.org/node/1619504
  */
 const DRUPAL_AUTHENTICATED_RID = AccountInterface::AUTHENTICATED_ROLE;
 
@@ -88,6 +92,8 @@
  *
  * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0.
  *   Use \Drupal::time()->getRequestTime();
+ *
+ * @see https://www.drupal.org/node/2785211
  */
 define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
 
@@ -105,6 +111,8 @@
  *
  * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core no
  *   longer creates an active directory.
+ *
+ * @see https://www.drupal.org/node/2501187
  */
 const CONFIG_ACTIVE_DIRECTORY = 'active';
 
@@ -123,6 +131,8 @@
  *
  * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. The staging
  *   directory was renamed to sync.
+ *
+ * @see https://www.drupal.org/node/2574957
  */
 const CONFIG_STAGING_DIRECTORY = 'staging';
 
@@ -315,6 +325,10 @@ function t($string, array $args = [], array $options = []) {
  *
  * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
  *   Use \Drupal\Component\Render\FormattableMarkup.
+ *
+ * @see https://www.drupal.org/node/2302363
+ * @see https://www.drupal.org/node/1312890
+ *
  */
 function format_string($string, array $args) {
   return SafeMarkup::format($string, $args);
@@ -348,6 +362,8 @@ function format_string($string, array $args) {
  *
  * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
  *   Use \Drupal\Component\Utility\Unicode::validateUtf8().
+ *
+ * @see https://www.drupal.org/node/1992584
  */
 function drupal_validate_utf8($text) {
   return Unicode::validateUtf8($text);
@@ -742,6 +758,8 @@ function drupal_installation_attempted() {
  *   need to access the value before container is available you can use
  *   BootstrapConfigStorageFactory to load the value directly from
  *   configuration.
+ *
+ * @see https://www.drupal.org/node/2235431
  */
 function drupal_get_profile() {
   global $install_state;
@@ -953,6 +971,7 @@ function drupal_static_reset($name = NULL) {
  *   does not mark the string as safe.
  *
  * @see \Drupal\Component\Utility\SafeMarkup::format()
+ * @see https://www.drupal.org/node/2302363
  */
 function drupal_placeholder($text) {
   return '<em class="placeholder">' . Html::escape($text) . '</em>';
diff --git a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
index 42f309d..0f068ab 100644
--- a/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
+++ b/core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\datetime\Tests\Views;
 
+@trigger_error('\Drupal\datetime\Tests\Views\DateTimeHandlerTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\BrowserTestBase', E_USER_DEPRECATED);
+
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\node\Entity\NodeType;
@@ -11,6 +13,9 @@
 
 /**
  * Base class for testing datetime handlers.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
+ *   Use \Drupal\Tests\BrowserTestBase.
  */
 abstract class DateTimeHandlerTestBase extends HandlerTestBase {
 
diff --git a/core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
similarity index 94%
rename from core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
rename to core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
index e3a17bb..6145483 100644
--- a/core/modules/datetime/src/Tests/Views/ArgumentDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/ArgumentDateTimeTest.php
@@ -1,7 +1,8 @@
 <?php
 
-namespace Drupal\datetime\Tests\Views;
+namespace Drupal\Tests\datetime\Kernel\Views;
 
+use Drupal\node\Entity\Node;
 use Drupal\views\Views;
 
 /**
@@ -19,8 +20,8 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     // Add some basic test nodes.
     $dates = [
@@ -29,11 +30,15 @@ protected function setUp() {
       '2002-01-01',
     ];
     foreach ($dates as $date) {
-      $this->nodes[] = $this->drupalCreateNode([
+      $node = Node::create([
+        'title' => $this->randomMachineName(8),
+        'type' => 'page',
         'field_date' => [
           'value' => $date,
         ]
       ]);
+      $node->save();
+      $this->nodes[] = $node;
     }
   }
 
diff --git a/core/modules/datetime/tests/src/Kernel/Views/DateTimeHandlerTestBase.php b/core/modules/datetime/tests/src/Kernel/Views/DateTimeHandlerTestBase.php
new file mode 100644
index 0000000..f0c9c78
--- /dev/null
+++ b/core/modules/datetime/tests/src/Kernel/Views/DateTimeHandlerTestBase.php
@@ -0,0 +1,79 @@
+<?php
+
+namespace Drupal\Tests\datetime\Kernel\Views;
+
+use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\node\Entity\NodeType;
+use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
+use Drupal\views\Tests\ViewTestData;
+use Drupal\field\Entity\FieldStorageConfig;
+
+/**
+ * Base class for testing datetime handlers.
+ */
+abstract class DateTimeHandlerTestBase extends ViewsKernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['datetime_test', 'node', 'datetime', 'field'];
+
+  /**
+   * Name of the field.
+   *
+   * Note, this is used in the default test view.
+   *
+   * @var string
+   */
+  protected static $field_name = 'field_date';
+
+  /**
+   * Nodes to test.
+   *
+   * @var \Drupal\node\NodeInterface[]
+   */
+  protected $nodes = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
+
+    $this->installEntitySchema('node');
+    $this->installEntitySchema('user');
+
+    // Add a date field to page nodes.
+    $node_type = NodeType::create([
+      'type' => 'page',
+      'name' => 'page'
+    ]);
+    $node_type->save();
+    $fieldStorage = FieldStorageConfig::create([
+      'field_name' => static::$field_name,
+      'entity_type' => 'node',
+      'type' => 'datetime',
+      'settings' => ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATETIME],
+    ]);
+    $fieldStorage->save();
+    $field = FieldConfig::create([
+      'field_storage' => $fieldStorage,
+      'bundle' => 'page',
+      'required' => TRUE,
+    ]);
+    $field->save();
+
+    // Views needs to be aware of the new field.
+    $this->container->get('views.views_data')->clear();
+
+    // Set column map.
+    $this->map = [
+      'nid' => 'nid',
+    ];
+
+    // Load test views.
+    ViewTestData::createTestViews(get_class($this), ['datetime_test']);
+  }
+
+}
diff --git a/core/modules/datetime/src/Tests/Views/FilterDateTest.php b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
similarity index 90%
rename from core/modules/datetime/src/Tests/Views/FilterDateTest.php
rename to core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
index 2a8d7cd..566285e 100644
--- a/core/modules/datetime/src/Tests/Views/FilterDateTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTest.php
@@ -1,8 +1,10 @@
 <?php
 
-namespace Drupal\datetime\Tests\Views;
+namespace Drupal\Tests\datetime\Kernel\Views;
+
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
 use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\node\Entity\Node;
 use Drupal\views\Views;
 
 /**
@@ -27,8 +29,8 @@ class FilterDateTest extends DateTimeHandlerTestBase {
    *
    * Create nodes with relative dates of yesterday, today, and tomorrow.
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     // Set to 'today'.
     static::$date = REQUEST_TIME;
@@ -48,11 +50,15 @@ protected function setUp() {
     ];
 
     foreach ($dates as $date) {
-      $this->nodes[] = $this->drupalCreateNode([
+      $node = Node::create([
+        'title' => $this->randomMachineName(8),
+        'type' => 'page',
         'field_date' => [
           'value' => $date,
         ]
       ]);
+      $node->save();
+      $this->nodes[] = $node;
     }
   }
 
diff --git a/core/modules/datetime/src/Tests/Views/FilterDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
similarity index 94%
rename from core/modules/datetime/src/Tests/Views/FilterDateTimeTest.php
rename to core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
index a15263d..1e8e929 100644
--- a/core/modules/datetime/src/Tests/Views/FilterDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/FilterDateTimeTest.php
@@ -1,7 +1,8 @@
 <?php
 
-namespace Drupal\datetime\Tests\Views;
+namespace Drupal\Tests\datetime\Kernel\Views;
 
+use Drupal\node\Entity\Node;
 use Drupal\views\Views;
 
 /**
@@ -29,8 +30,8 @@ class FilterDateTimeTest extends DateTimeHandlerTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     static::$date = REQUEST_TIME + 86400;
 
@@ -47,11 +48,15 @@ protected function setUp() {
       \Drupal::service('date.formatter')->format(static::$date, 'custom', DATETIME_DATETIME_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE),
     ];
     foreach ($dates as $date) {
-      $this->nodes[] = $this->drupalCreateNode([
+      $node = Node::create([
+        'title' => $this->randomMachineName(8),
+        'type' => 'page',
         'field_date' => [
           'value' => $date,
         ]
       ]);
+      $node->save();
+      $this->nodes[] = $node;
     }
   }
 
diff --git a/core/modules/datetime/src/Tests/Views/SortDateTimeTest.php b/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
similarity index 91%
rename from core/modules/datetime/src/Tests/Views/SortDateTimeTest.php
rename to core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
index c1f23a0..7375c4d 100644
--- a/core/modules/datetime/src/Tests/Views/SortDateTimeTest.php
+++ b/core/modules/datetime/tests/src/Kernel/Views/SortDateTimeTest.php
@@ -1,7 +1,8 @@
 <?php
 
-namespace Drupal\datetime\Tests\Views;
+namespace Drupal\Tests\datetime\Kernel\Views;
 
+use Drupal\node\Entity\Node;
 use Drupal\views\Views;
 
 /**
@@ -19,8 +20,8 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     // Add some basic test nodes.
     $dates = [
@@ -33,11 +34,15 @@ protected function setUp() {
       '2000-10-10T00:03:03',
     ];
     foreach ($dates as $date) {
-      $this->nodes[] = $this->drupalCreateNode([
+      $node = Node::create([
+        'title' => $this->randomMachineName(8),
+        'type' => 'page',
         'field_date' => [
           'value' => $date,
         ]
       ]);
+      $node->save();
+      $this->nodes[] = $node;
     }
   }
 
diff --git a/core/modules/language/src/Tests/EntityTypeWithoutLanguageFormTest.php b/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
similarity index 87%
rename from core/modules/language/src/Tests/EntityTypeWithoutLanguageFormTest.php
rename to core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
index 97ccf2f..f7b6191 100644
--- a/core/modules/language/src/Tests/EntityTypeWithoutLanguageFormTest.php
+++ b/core/modules/language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php
@@ -1,8 +1,8 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests entity type without language support.
@@ -12,7 +12,7 @@
  *
  * @group language
  */
-class EntityTypeWithoutLanguageFormTest extends WebTestBase {
+class EntityTypeWithoutLanguageFormTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
similarity index 98%
rename from core/modules/language/src/Tests/LanguageConfigurationElementTest.php
rename to core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
index dc3eb26..87ad05b 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
@@ -1,19 +1,19 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\language\Entity\ContentLanguageSettings;
-use Drupal\simpletest\WebTestBase;
 use Drupal\taxonomy\Entity\Vocabulary;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests the features of the language configuration element field.
  *
  * @group language
  */
-class LanguageConfigurationElementTest extends WebTestBase {
+class LanguageConfigurationElementTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
similarity index 98%
rename from core/modules/language/src/Tests/LanguageConfigurationTest.php
rename to core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 46d5ed7..9ed7abd 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -1,17 +1,17 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Adds and configures languages to check negotiation changes.
  *
  * @group language
  */
-class LanguageConfigurationTest extends WebTestBase {
+class LanguageConfigurationTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -169,10 +169,7 @@ public function testLanguageConfigurationWeight() {
     $this->checkConfigurableLanguageWeight('after re-ordering');
 
     // Remove predefined language.
-    $edit = [
-      'confirm' => 1,
-    ];
-    $this->drupalPostForm('admin/config/regional/language/delete/fr', $edit, 'Delete');
+    $this->drupalPostForm('admin/config/regional/language/delete/fr', [], 'Delete');
     $this->checkConfigurableLanguageWeight('after deleting a language');
   }
 
diff --git a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
similarity index 96%
rename from core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
rename to core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
index 2eb02df..a0510be 100644
--- a/core/modules/language/src/Tests/LanguageCustomLanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
@@ -1,17 +1,17 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
-use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Adds and configures custom languages.
  *
  * @group language
  */
-class LanguageCustomLanguageConfigurationTest extends WebTestBase {
+class LanguageCustomLanguageConfigurationTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php
similarity index 93%
rename from core/modules/language/src/Tests/LanguageListTest.php
rename to core/modules/language/tests/src/Functional/LanguageListTest.php
index 641ddc4..8c671cf 100644
--- a/core/modules/language/src/Tests/LanguageListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageListTest.php
@@ -1,18 +1,18 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Adds a new language and tests changing its status and the default language.
  *
  * @group language
  */
-class LanguageListTest extends WebTestBase {
+class LanguageListTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -176,9 +176,20 @@ public function testLanguageList() {
     $this->assertResponse(403, 'Can not delete locked language');
 
     // Ensure that NL cannot be set default when it's not available.
+    // First create the NL language.
+    $edit = [
+      'predefined_langcode' => 'nl',
+    ];
+    $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
+
+    // Load the form which has now the additional NL language option.
     $this->drupalGet('admin/config/regional/language');
-    $extra_values = '&site_default_language=nl';
-    $this->drupalPostForm(NULL, [], t('Save configuration'), [], [], NULL, $extra_values);
+
+    // Delete the NL language in the background.
+    $language_storage = $this->container->get('entity_type.manager')->getStorage('configurable_language');
+    $language_storage->load('nl')->delete();
+
+    $this->drupalPostForm(NULL, ['site_default_language' => 'nl'], 'Save configuration');
     $this->assertText(t('Selected default language no longer exists.'));
     $this->assertNoFieldChecked('edit-site-default-language-xx', 'The previous default language got deselected.');
   }
diff --git a/core/modules/language/src/Tests/LanguageLocaleListTest.php b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
similarity index 84%
rename from core/modules/language/src/Tests/LanguageLocaleListTest.php
rename to core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
index 5f96d89..a39a112 100644
--- a/core/modules/language/src/Tests/LanguageLocaleListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
@@ -1,15 +1,15 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Adds a new language with translations and tests language list order.
  *
  * @group language
  */
-class LanguageLocaleListTest extends WebTestBase {
+class LanguageLocaleListTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -57,9 +57,11 @@ public function testLanguageLocaleList() {
 
     // Get language list displayed in select list.
     $this->drupalGet('fr/admin/config/regional/language/add');
-    $select = $this->xpath('//select[@id="edit-predefined-langcode"]');
-    $select_element = (array) end($select);
-    $options = $select_element['option'];
+    $option_elements = $this->xpath('//select[@id="edit-predefined-langcode/option"]');
+    $options = [];
+    foreach ($option_elements as $option_element) {
+      $options[] = $option_element->getText();
+    }
     // Remove the 'Custom language...' option form the end.
     array_pop($options);
     // Order language list.
diff --git a/core/modules/language/src/Tests/LanguageSelectorTranslatableTest.php b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
similarity index 88%
rename from core/modules/language/src/Tests/LanguageSelectorTranslatableTest.php
rename to core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
index d13626c..3d027c3 100644
--- a/core/modules/language/src/Tests/LanguageSelectorTranslatableTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
@@ -1,15 +1,15 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests the content translation settings language selector options.
  *
  * @group language
  */
-class LanguageSelectorTranslatableTest extends WebTestBase {
+class LanguageSelectorTranslatableTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -82,7 +82,7 @@ public function testLanguageStringSelector() {
     $elements = $this->xpath('//select[@id=:id]//option[@value=:option]', [':id' => 'edit-settings-user-user-settings-language-langcode', ':option' => 'en']);
 
     // Check that the language text is translated.
-    $this->assertEqual((string) $elements[0], $name_translation, 'Checking the option string English is translated to Spanish.');
+    $this->assertEqual($elements[0]->getText(), $name_translation, 'Checking the option string English is translated to Spanish.');
   }
 
 }
diff --git a/core/modules/language/src/Tests/LanguageSwitchingTest.php b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
similarity index 94%
rename from core/modules/language/src/Tests/LanguageSwitchingTest.php
rename to core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
index 4001521..1303082 100644
--- a/core/modules/language/src/Tests/LanguageSwitchingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
@@ -1,19 +1,19 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
 use Drupal\menu_link_content\Entity\MenuLinkContent;
 use Drupal\Core\Language\LanguageInterface;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Functional tests for the language switching feature.
  *
  * @group language
  */
-class LanguageSwitchingTest extends WebTestBase {
+class LanguageSwitchingTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -73,22 +73,24 @@ protected function doTestLanguageBlockAuthenticated($block_label) {
 
     // Assert that each list item and anchor element has the appropriate data-
     // attributes.
-    list($language_switcher) = $this->xpath('//div[@id=:id]', [':id' => 'block-test-language-block']);
+    $language_switchers = $this->xpath('//div[@id=:id]/ul/li', [':id' => 'block-test-language-block']);
     $list_items = [];
     $anchors = [];
     $labels = [];
-    foreach ($language_switcher->ul->li as $list_item) {
-      $classes = explode(" ", (string) $list_item['class']);
+    foreach ($language_switchers as $list_item) {
+      $classes = explode(" ", $list_item->getAttribute('class'));
       list($langcode) = array_intersect($classes, ['en', 'fr']);
       $list_items[] = [
         'langcode_class' => $langcode,
-        'data-drupal-link-system-path' => (string) $list_item['data-drupal-link-system-path'],
+        'data-drupal-link-system-path' => $list_item->getAttribute('data-drupal-link-system-path'),
       ];
+
+      $link = $list_item->find('xpath', 'a');
       $anchors[] = [
-        'hreflang' => (string) $list_item->a['hreflang'],
-        'data-drupal-link-system-path' => (string) $list_item->a['data-drupal-link-system-path'],
+         'hreflang' => $link->getAttribute('hreflang'),
+         'data-drupal-link-system-path' => $link->getAttribute('data-drupal-link-system-path'),
       ];
-      $labels[] = (string) $list_item->a;
+      $labels[] = $link->getText();
     }
     $expected_list_items = [
       0 => ['langcode_class' => 'en', 'data-drupal-link-system-path' => 'user/2'],
@@ -124,7 +126,7 @@ protected function doTestLanguageBlockAnonymous($block_label) {
     $this->assertText($block_label, 'Language switcher block found.');
 
     // Assert that only the current language is marked as active.
-    list($language_switcher) = $this->xpath('//div[@id=:id]', [':id' => 'block-test-language-block']);
+    $language_switchers = $this->xpath('//div[@id=:id]/ul/li', [':id' => 'block-test-language-block']);
     $links = [
       'active' => [],
       'inactive' => [],
@@ -134,8 +136,8 @@ protected function doTestLanguageBlockAnonymous($block_label) {
       'inactive' => [],
     ];
     $labels = [];
-    foreach ($language_switcher->ul->li as $link) {
-      $classes = explode(" ", (string) $link['class']);
+    foreach ($language_switchers as $list_item) {
+      $classes = explode(" ", $list_item->getAttribute('class'));
       list($langcode) = array_intersect($classes, ['en', 'fr']);
       if (in_array('is-active', $classes)) {
         $links['active'][] = $langcode;
@@ -143,14 +145,16 @@ protected function doTestLanguageBlockAnonymous($block_label) {
       else {
         $links['inactive'][] = $langcode;
       }
-      $anchor_classes = explode(" ", (string) $link->a['class']);
+
+      $link = $list_item->find('xpath', 'a');
+      $anchor_classes = explode(" ", $link->getAttribute('class'));
       if (in_array('is-active', $anchor_classes)) {
         $anchors['active'][] = $langcode;
       }
       else {
         $anchors['inactive'][] = $langcode;
       }
-      $labels[] = (string) $link->a;
+      $labels[] = $link->getText();
     }
     $this->assertIdentical($links, ['active' => ['en'], 'inactive' => ['fr']], 'Only the current language list item is marked as active on the language switcher block.');
     $this->assertIdentical($anchors, ['active' => ['en'], 'inactive' => ['fr']], 'Only the current language anchor is marked as active on the language switcher block.');
@@ -208,7 +212,7 @@ public function testLanguageBlockWithDomain() {
       ':hreflang' => 'en',
     ]);
     $english_url = $generator->generateFromRoute('entity.user.canonical', ['user' => 2], ['language' => $languages['en']]);
-    $this->assertEqual($english_url, (string) $english_link['href']);
+    $this->assertEqual($english_url, $english_link->getAttribute('href'));
 
     // Verify the Italian URL is correct
     list($italian_link) = $this->xpath('//div[@id=:id]/ul/li/a[@hreflang=:hreflang]', [
@@ -216,7 +220,7 @@ public function testLanguageBlockWithDomain() {
       ':hreflang' => 'it',
     ]);
     $italian_url = $generator->generateFromRoute('entity.user.canonical', ['user' => 2], ['language' => $languages['it']]);
-    $this->assertEqual($italian_url, (string) $italian_link['href']);
+    $this->assertEqual($italian_url, $italian_link->getAttribute('href'));
   }
 
   /**
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
similarity index 97%
rename from core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
rename to core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
index 3f54cf9..34f0c81 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\Core\Url;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -8,9 +8,9 @@
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSession;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
+use Drupal\Tests\BrowserTestBase;
 use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUser;
 use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin;
-use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Symfony\Component\HttpFoundation\Request;
@@ -37,7 +37,7 @@
  *
  * @group language
  */
-class LanguageUILanguageNegotiationTest extends WebTestBase {
+class LanguageUILanguageNegotiationTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -69,9 +69,9 @@ public function testUILanguageNegotiation() {
     // For testing path prefix.
     $langcode = 'zh-hans';
     // For setting browser language preference to 'vi'.
-    $http_header_browser_fallback = ["Accept-Language: $langcode_browser_fallback;q=1"];
+    $http_header_browser_fallback = ["Accept-Language" => "$langcode_browser_fallback;q=1"];
     // For setting browser language preference to some unknown.
-    $http_header_blah = ["Accept-Language: blah;q=1"];
+    $http_header_blah = ["Accept-Language" => "blah;q=1"];
 
     // Setup the site languages by installing two languages.
     // Set the default language in order for the translated string to be registered
@@ -107,7 +107,7 @@ public function testUILanguageNegotiation() {
     ];
     $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
     $textarea = current($this->xpath('//textarea'));
-    $lid = (string) $textarea[0]['name'];
+    $lid = $textarea->getAttribute('name');
     $edit = [
       $lid => $language_browser_fallback_string,
     ];
@@ -119,7 +119,7 @@ public function testUILanguageNegotiation() {
     ];
     $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
     $textarea = current($this->xpath('//textarea'));
-    $lid = (string) $textarea[0]['name'];
+    $lid = $textarea->getAttribute('name');
     $edit = [
       $lid => $language_string,
     ];
@@ -398,7 +398,7 @@ public function testUrlLanguageFallback() {
 
     // Access the front page without specifying any valid URL language prefix
     // and having as browser language preference a non-default language.
-    $http_header = ["Accept-Language: $langcode_browser_fallback;q=1"];
+    $http_header = ["Accept-Language" => "$langcode_browser_fallback;q=1"];
     $language = new Language(['id' => '']);
     $this->drupalGet('', ['language' => $language], $http_header);
 
@@ -406,11 +406,11 @@ public function testUrlLanguageFallback() {
     // language.
     $args = [':id' => 'block-test-language-block', ':url' => \Drupal::url('<front>') . $langcode_browser_fallback];
     $fields = $this->xpath('//div[@id=:id]//a[@class="language-link is-active" and starts-with(@href, :url)]', $args);
-    $this->assertTrue($fields[0] == $languages[$langcode_browser_fallback]->getName(), 'The browser language is the URL active language');
+    $this->assertSame($fields[0]->getText(), $languages[$langcode_browser_fallback]->getName(), 'The browser language is the URL active language');
 
     // Check that URLs are rewritten using the given browser language.
     $fields = $this->xpath('//div[@class="site-name"]/a[@rel="home" and @href=:url]', $args);
-    $this->assertTrue($fields[0] == 'Drupal', 'URLs are rewritten using the browser language.');
+    $this->assertSame($fields[0]->getText(), 'Drupal', 'URLs are rewritten using the browser language.');
   }
 
   /**
diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
similarity index 96%
rename from core/modules/language/src/Tests/LanguageUrlRewritingTest.php
rename to core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
index 65ae64c..7021aa0 100644
--- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
@@ -1,12 +1,12 @@
 <?php
 
-namespace Drupal\language\Tests;
+namespace Drupal\Tests\language\Functional;
 
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Url;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -14,7 +14,7 @@
  *
  * @group language
  */
-class LanguageUrlRewritingTest extends WebTestBase {
+class LanguageUrlRewritingTest extends BrowserTestBase {
 
   /**
    * Modules to enable.
@@ -90,9 +90,8 @@ private function checkUrl(LanguageInterface $language, $message1, $message2) {
     // we can always check the prefixed URL.
     $prefixes = language_negotiation_url_prefixes();
     $stored_prefix = isset($prefixes[$language->getId()]) ? $prefixes[$language->getId()] : $this->randomMachineName();
-    if ($this->assertNotEqual($stored_prefix, $prefix, $message1)) {
-      $prefix = $stored_prefix;
-    }
+    $this->assertNotEqual($stored_prefix, $prefix, $message1);
+    $prefix = $stored_prefix;
 
     $this->drupalGet("$prefix/$path");
     $this->assertResponse(404, $message2);
