diff --git a/core/includes/common.inc b/core/includes/common.inc
index 667807a..48aa546 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2,7 +2,6 @@
 
 use Drupal\Component\Utility\Crypt;
 use Drupal\Component\Utility\String;
-use Drupal\Component\Utility\Tags;
 use Drupal\Component\Utility\UrlValidator;
 use Drupal\Component\Utility\Xss;
 use Drupal\Core\Cache\Cache;
@@ -15,7 +14,6 @@
 use Drupal\Component\PhpStorage\PhpStorageFactory;
 use Drupal\Component\Utility\MapArray;
 use Drupal\Component\Utility\NestedArray;
-use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\Core\Database\Database;
@@ -791,8 +789,6 @@ function valid_email_address($mail) {
  *   TRUE if the URL is in a valid format.
  *
  * @see \Drupal\Component\Utility\UrlValidator::isValid()
- *
- * @deprecated as of Drupal 8.0. Use UrlValidator::isValid() instead.
  */
 function valid_url($url, $absolute = FALSE) {
   return UrlValidator::isValid($url, $absolute);
@@ -5512,24 +5508,44 @@ function watchdog_severity_levels() {
  * Explodes a string of tags into an array.
  *
  * @see drupal_implode_tags()
- * @see \Drupal\Component\Utility\String::explodeTags().
- *
- * @deprecated as of Drupal 8.0. Use Tags::explode() instead.
  */
 function drupal_explode_tags($tags) {
-  return Tags::explode($tags);
+  // This regexp allows the following types of user input:
+  // this, "somecompany, llc", "and ""this"" w,o.rks", foo bar
+  $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';
+  preg_match_all($regexp, $tags, $matches);
+  $typed_tags = array_unique($matches[1]);
+
+  $tags = array();
+  foreach ($typed_tags as $tag) {
+    // If a user has escaped a term (to demonstrate that it is a group,
+    // or includes a comma or quote character), we remove the escape
+    // formatting so to save the term into the database as the user intends.
+    $tag = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $tag)));
+    if ($tag != "") {
+      $tags[] = $tag;
+    }
+  }
+
+  return $tags;
 }
 
 /**
  * Implodes an array of tags into a string.
  *
  * @see drupal_explode_tags()
- * @see \Drupal\Component\Utility\String::implodeTags().
- *
- * @deprecated as of Drupal 8.0. Use Tags::implode() instead.
  */
 function drupal_implode_tags($tags) {
-  return Tags::implode($tags);
+  $encoded_tags = array();
+  foreach ($tags as $tag) {
+    // Commas and quotes in tag names are special cases, so encode them.
+    if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) {
+      $tag = '"' . str_replace('"', '""', $tag) . '"';
+    }
+
+    $encoded_tags[] = $tag;
+  }
+  return implode(', ', $encoded_tags);
 }
 
 /**
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index ae8ec15..67624aa 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -12,6 +12,7 @@
 use Drupal\Core\Config\Config;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Template\Attribute;
+use Drupal\Core\Template\RenderWrapper;
 use Drupal\Core\Utility\ThemeRegistry;
 use Drupal\Core\Theme\ThemeSettings;
 use Drupal\Component\Utility\NestedArray;
@@ -2751,6 +2752,26 @@ function template_preprocess_html(&$variables) {
   if ($suggestions = theme_get_suggestions(arg(), 'html')) {
     $variables['theme_hook_suggestions'] = $suggestions;
   }
+
+  drupal_add_library('system', 'html5shiv', TRUE);
+  // Render page_top and page_bottom into top level variables.
+  $variables['page_top'] = isset($variables['page']['page_top']) ? drupal_render($variables['page']['page_top']) : '';
+
+  // Wrapping function calls in an object so they can be called when printed.
+  $variables['head'] = new RenderWrapper('drupal_get_html_head');
+  $variables['styles'] = new RenderWrapper('drupal_get_css');
+  $variables['scripts'] = new RenderWrapper('drupal_get_js');
+
+  $variables['page_bottom'] = array();
+  $variables['page_bottom'][] = isset($variables['page']['page_bottom']) ? drupal_render($variables['page']['page_bottom']) : array();
+  // Adding footer scripts through markup so it can be rendered with other
+  // elements in page_bottom.
+  $footer_scripts = new RenderWrapper('drupal_get_js', array('footer'));
+  $variables['page_bottom'][] = array('#markup' => $footer_scripts);
+
+  // Place the rendered HTML for the page body into a top level variable.
+  $variables['page'] = drupal_render($variables['page']);
+  //$variables['page'] = $variables['page']['#children'];
 }
 
 /**
@@ -2877,30 +2898,6 @@ function template_process_page(&$variables) {
 }
 
 /**
- * Processes variables for html.html.twig.
- *
- * Perform final addition and modification of variables before passing into
- * the template. To customize these variables, call drupal_render() on elements
- * in $variables['page'] during THEME_preprocess_page().
- *
- * @see template_preprocess_html()
- */
-function template_process_html(&$variables) {
-  drupal_add_library('system', 'html5shiv', TRUE);
-  // Render page_top and page_bottom into top level variables.
-  $variables['page_top'] = isset($variables['page']['page_top']) ? drupal_render($variables['page']['page_top']) : '';
-  $variables['page_bottom'] = isset($variables['page']['page_bottom']) ? drupal_render($variables['page']['page_bottom']) : '';
-  // Place the rendered HTML for the page body into a top level variable.
-  $variables['page'] = $variables['page']['#children'];
-  $variables['page_bottom'] .= drupal_get_js('footer');
-
-  $variables['head']    = drupal_get_html_head();
-  $variables['css']     = drupal_add_css();
-  $variables['styles']  = drupal_get_css();
-  $variables['scripts'] = drupal_get_js();
-}
-
-/**
  * Generate an array of suggestions from path arguments.
  *
  * This is typically called for adding to the 'theme_hook_suggestions' or
@@ -3073,18 +3070,7 @@ function template_preprocess_maintenance_page(&$variables) {
   if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
     $variables['theme_hook_suggestion'] = 'maintenance_page__offline';
   }
-}
 
-/**
- * Theme process function for theme_maintenance_field().
- *
- * The variables array generated here is a mirror of template_process_html().
- * This processor will run its course when theme_maintenance_page() is invoked.
- *
- * @see maintenance-page.html.twig
- * @see template_process_html()
- */
-function template_process_maintenance_page(&$variables) {
   $variables['head'] = drupal_get_html_head();
 
   // While this code is used in the installer, the language module may not be
@@ -3093,9 +3079,11 @@ function template_process_maintenance_page(&$variables) {
   $variables['css'] = $css = drupal_add_css();
   include_once DRUPAL_ROOT . '/core/modules/language/language.module';
   language_css_alter($css);
-  $variables['styles'] = drupal_get_css($css);
 
-  $variables['scripts'] = drupal_get_js();
+  // Wrapping drupal_get_css() and drupal_get_js() in an object so they can
+  // be called when printed.
+  $variables['styles'] = new RenderWrapper('drupal_get_css', $args = array($css));
+  $variables['scripts'] = new RenderWrapper('drupal_get_js');
 }
 
 /**
diff --git a/core/lib/Drupal/Component/Utility/Tags.php b/core/lib/Drupal/Component/Utility/Tags.php
deleted file mode 100644
index 075eaec..0000000
--- a/core/lib/Drupal/Component/Utility/Tags.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Component\Utility\Tags.
- */
-
-namespace Drupal\Component\Utility;
-
-/**
- * Defines a class that can explode and implode tags.
- */
-class Tags {
-
-  /**
-   * Explodes a string of tags into an array.
-   *
-   * @param string $tags
-   *   A string to explode.
-   *
-   * @return array
-   *   An array of tags.
-   */
-  public static function explode($tags) {
-    // This regexp allows the following types of user input:
-    // this, "somecompany, llc", "and ""this"" w,o.rks", foo bar
-    $regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x';
-    preg_match_all($regexp, $tags, $matches);
-    $typed_tags = array_unique($matches[1]);
-
-    $tags = array();
-    foreach ($typed_tags as $tag) {
-      // If a user has escaped a term (to demonstrate that it is a group,
-      // or includes a comma or quote character), we remove the escape
-      // formatting so to save the term into the database as the user intends.
-      $tag = trim(str_replace('""', '"', preg_replace('/^"(.*)"$/', '\1', $tag)));
-      if ($tag != "") {
-        $tags[] = $tag;
-      }
-    }
-
-    return $tags;
-  }
-
-  /**
-   * Implodes an array of tags into a string.
-   *
-   * @param array $tags
-   *   An array of tags.
-   *
-   * @return string
-   *   The imploded string.
-   */
-  public static function implode($tags) {
-    $encoded_tags = array();
-    foreach ($tags as $tag) {
-      // Commas and quotes in tag names are special cases, so encode them.
-      if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) {
-        $tag = '"' . str_replace('"', '""', $tag) . '"';
-      }
-
-      $encoded_tags[] = $tag;
-    }
-    return implode(', ', $encoded_tags);
-  }
-
-}
diff --git a/core/lib/Drupal/Core/Template/AttributeArray.php b/core/lib/Drupal/Core/Template/AttributeArray.php
index a32201e..d3521e0 100644
--- a/core/lib/Drupal/Core/Template/AttributeArray.php
+++ b/core/lib/Drupal/Core/Template/AttributeArray.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\Core\Template;
 
-use Drupal\Component\Utility\String;
 
 /**
  * A class that defines a type of Attribute that can be added to as an array.
@@ -67,7 +66,7 @@ public function offsetExists($offset) {
    */
   public function __toString() {
     $this->printed = TRUE;
-    return implode(' ', array_map(array('Drupal\Component\Utility\String', 'checkPlain'), $this->value));
+    return implode(' ', array_map('check_plain', $this->value));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Template/AttributeString.php b/core/lib/Drupal/Core/Template/AttributeString.php
index 2c3ca24..9776467 100644
--- a/core/lib/Drupal/Core/Template/AttributeString.php
+++ b/core/lib/Drupal/Core/Template/AttributeString.php
@@ -7,8 +7,6 @@
 
 namespace Drupal\Core\Template;
 
-use Drupal\Component\Utility\String;
-
 /**
  * A class that represents most standard HTML attributes.
  *
@@ -31,7 +29,7 @@ class AttributeString extends AttributeValueBase {
    */
   public function __toString() {
     $this->printed = TRUE;
-    return String::checkPlain($this->value);
+    return check_plain($this->value);
   }
 
 }
diff --git a/core/lib/Drupal/Core/Template/RenderWrapper.php b/core/lib/Drupal/Core/Template/RenderWrapper.php
new file mode 100644
index 0000000..ff626bf
--- /dev/null
+++ b/core/lib/Drupal/Core/Template/RenderWrapper.php
@@ -0,0 +1,67 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Template\RenderWrapper.
+ */
+
+namespace Drupal\Core\Template;
+
+/**
+ * A class that wraps functions to call them while printing in a template.
+ *
+ * To use, one may pass in the function name as a string followed by an array of
+ * arguments to the contstructor.
+ * @code
+ *  $variables['scripts'] = new RenderWrapper('drupal_get_js', array('footer'));
+ * @endcode
+ *
+ */
+class RenderWrapper {
+
+  /**
+   * Stores the callback function to be called when rendered.
+   *
+   * @var array
+   */
+  public $callback = NULL;
+
+  /**
+   * Stores the callback's arguments.
+   *
+   * @var array
+   */
+  public $args = array();
+
+  /**
+   * Constructs a RenderWrapper object.
+   *
+   * @param string $callback
+   *   The callback function name.
+   * @param array $args
+   *   The arguments to pass to the callback function.
+   */
+  public function __construct($callback = NULL, $args = array()) {
+    $this->callback = $callback;
+    $this->args = $args;
+  }
+
+  /**
+   * Implements the magic __toString() method.
+   */
+  public function __toString() {
+    return $this->render();
+  }
+
+  /**
+   * Returns a string provided by the callback function.
+   *
+   * @return string
+   *   The results of the drupal_get_* functions.
+   */
+  public function render() {
+   if (!empty($this->callback) && is_callable($this->callback)) {
+      return call_user_func_array($this->callback, $this->args);
+    }
+  }
+}
diff --git a/core/modules/aggregator/aggregator.routing.yml b/core/modules/aggregator/aggregator.routing.yml
index 311ff42..6a94734 100644
--- a/core/modules/aggregator/aggregator.routing.yml
+++ b/core/modules/aggregator/aggregator.routing.yml
@@ -1,7 +1,7 @@
 aggregator_admin_overview:
   pattern: 'admin/config/services/aggregator'
   defaults:
-    _content: '\Drupal\aggregator\Controller\AggregatorController::adminOverview'
+    _content: '\Drupal\aggregator\Routing\AggregatorController::adminOverview'
   requirements:
     _permission: 'administer news feeds'
 
@@ -29,14 +29,14 @@ aggregator_feed_delete:
 aggregator_feed_add:
   pattern: '/admin/config/services/aggregator/add/feed'
   defaults:
-    _content: '\Drupal\aggregator\Controller\AggregatorController::feedAdd'
+    _content: '\Drupal\aggregator\Routing\AggregatorController::feedAdd'
   requirements:
     _permission: 'administer news feeds'
 
 aggregator_feed_refresh:
   pattern: '/admin/config/services/aggregator/update/{aggregator_feed}'
   defaults:
-    _controller: '\Drupal\aggregator\Controller\AggregatorController::feedRefresh'
+    _controller: '\Drupal\aggregator\Routing\AggregatorController::feedRefresh'
   requirements:
     _permission: 'administer news feeds'
 
@@ -50,13 +50,13 @@ aggregator_opml_add:
 aggregator_page_last:
   pattern: '/aggregator'
   defaults:
-    _controller: '\Drupal\aggregator\Controller\AggregatorController::pageLast'
+    _controller: '\Drupal\aggregator\Routing\AggregatorController::pageLast'
   requirements:
     _permission: 'access news feeds'
 
 aggregator_sources:
   pattern: '/aggregator/sources'
   defaults:
-    _content: '\Drupal\aggregator\Controller\AggregatorController::sources'
+    _content: '\Drupal\aggregator\Routing\AggregatorController::sources'
   requirements:
     _permission: 'access news feeds'
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php
similarity index 98%
rename from core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
rename to core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php
index 663651f..838b031 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Routing/AggregatorController.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\aggregator\Controller\AggregatorController.
+ * Contains \Drupal\aggregator\Routing\AggregatorController.
  */
 
-namespace Drupal\aggregator\Controller;
+namespace Drupal\aggregator\Routing;
 
 use Drupal\aggregator\FeedInterface;
 use Drupal\Core\Config\ConfigFactory;
@@ -52,7 +52,7 @@ class AggregatorController implements ControllerInterface {
   protected $moduleHandler;
 
   /**
-   * Constructs a \Drupal\aggregator\Controller\AggregatorController object.
+   * Constructs a \Drupal\aggregator\Routing\AggregatorController object.
    *
    * @param \Drupal\Core\Entity\EntityManager $entity_manager
    *   The Entity manager.
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 4bcb3fa..cdec2b8 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -311,7 +311,7 @@ function _block_get_renderable_region($list = array()) {
   // to other users. We therefore exclude user 1 from block caching.
   $not_cacheable = $GLOBALS['user']->uid == 1 ||
     count(module_implements('node_grants')) ||
-    !\Drupal::request()->isMethodSafe();
+    !in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD'));
 
   foreach ($list as $key => $block) {
     $settings = $block->get('settings');
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
index 2457d97..405fabd 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
@@ -207,10 +207,9 @@ public function save(array $form, array &$form_state) {
    */
   public function delete(array $form, array &$form_state) {
     $destination = array();
-    $query = \Drupal::request()->query;
-    if (!is_null($query->get('destination'))) {
+    if (isset($_GET['destination'])) {
       $destination = drupal_get_destination();
-      $query->remove('destination');
+      unset($_GET['destination']);
     }
     $block = $this->buildEntity($form, $form_state);
     $form_state['redirect'] = array('block/' . $block->id() . '/delete', array('query' => $destination));
diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc
index 63118ab..8f30ada 100644
--- a/core/modules/book/book.admin.inc
+++ b/core/modules/book/book.admin.inc
@@ -219,9 +219,8 @@ function theme_book_admin_table($variables) {
     $form[$key]['mlid']['#attributes']['class'] = array('book-mlid');
     $form[$key]['weight']['#attributes']['class'] = array('book-weight');
 
-    $indentation = array('#theme' => 'indentation', '#size' => $form[$key]['depth']['#value'] - 2);
     $data = array(
-      drupal_render($indentation) . drupal_render($form[$key]['title']),
+      theme('indentation', array('size' => $form[$key]['depth']['#value'] - 2)) . drupal_render($form[$key]['title']),
       drupal_render($form[$key]['weight']),
       drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']),
     );
@@ -255,6 +254,6 @@ function theme_book_admin_table($variables) {
     $row['class'][] = 'draggable';
     $rows[] = $row;
   }
-  $table = array('#theme' => 'table', '#header' => $header, '#rows' => $rows, '#attributes' => array('id' => 'book-outline'), '#empty' => t('No book content available.'));
-  return drupal_render($table);
+
+  return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'book-outline'), 'empty' => t('No book content available.')));
 }
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 1fe04c8..39f08b9 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -773,9 +773,8 @@ function book_node_load($nodes, $types) {
 function book_node_view(EntityInterface $node, EntityDisplay $display, $view_mode) {
   if ($view_mode == 'full') {
     if (!empty($node->book['bid']) && empty($node->in_preview)) {
-      $book_navigation = array( '#theme' => 'book_navigation', '#book_link' => $node->book);
       $node->content['book_navigation'] = array(
-        '#markup' => drupal_render($book_navigation),
+        '#markup' => theme('book_navigation', array('book_link' => $node->book)),
         '#weight' => 100,
         '#attached' => array(
           'css' => array(
@@ -881,10 +880,9 @@ function book_node_prepare(EntityInterface $node) {
   if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) {
     $node->book = array();
 
-    $query = \Drupal::request()->query;
-    if (empty($node->nid) && !is_null($query->get('parent')) && is_numeric($query->get('parent'))) {
+    if (empty($node->nid) && isset($_GET['parent']) && is_numeric($_GET['parent'])) {
       // Handle "Add child page" links:
-      $parent = book_link_load($query->get('parent'));
+      $parent = book_link_load($_GET['parent']);
 
       if ($parent && $parent['access']) {
         $node->book['bid'] = $parent['bid'];
@@ -1190,8 +1188,8 @@ function book_node_export(EntityInterface $node, $children = '') {
   unset($build['#theme']);
   // @todo Rendering should happen in the template using render().
   $node->rendered = drupal_render($build);
-  $book_node_export_html = array('#theme' => 'book_node_export_html', '#node' => $node, '#children' => $children );
-  return drupal_render($book_node_export_html);
+
+  return theme('book_node_export_html', array('node' => $node, 'children' => $children));
 }
 
 /**
diff --git a/core/modules/book/book.pages.inc b/core/modules/book/book.pages.inc
index bc5ec53..67c4c99 100644
--- a/core/modules/book/book.pages.inc
+++ b/core/modules/book/book.pages.inc
@@ -72,8 +72,7 @@ function book_export_html(EntityInterface $node) {
     if (isset($node->book)) {
       $tree = book_menu_subtree_data($node->book);
       $contents = book_export_traverse($tree, 'book_node_export');
-      $book_exported_html = array('#theme' => 'book_export_html', '#title' => $node->label(), '#contents' => $contents, '#depth' => $node->book['depth']);
-      return drupal_render($book_exported_html);
+      return theme('book_export_html', array('title' => $node->label(), 'contents' => $contents, 'depth' => $node->book['depth']));
     }
     else {
       throw new NotFoundHttpException();
diff --git a/core/modules/book/lib/Drupal/book/Controller/BookController.php b/core/modules/book/lib/Drupal/book/Controller/BookController.php
index 7b10eaf..4b192b4 100644
--- a/core/modules/book/lib/Drupal/book/Controller/BookController.php
+++ b/core/modules/book/lib/Drupal/book/Controller/BookController.php
@@ -67,8 +67,8 @@ public function adminOverview() {
       );
       $rows[] = $row;
     }
-    $table = array('#theme' => 'table', '#header' => $headers, '#rows' => $rows, '#empty' => t('No books available.'));
-    return drupal_render($table);
+
+    return theme('table', array('header' => $headers, 'rows' => $rows, 'empty' => t('No books available.')));
   }
 
   /**
@@ -82,8 +82,8 @@ public function bookRender() {
     foreach ($this->bookManager->getAllBooks() as $book) {
       $book_list[] = l($book['title'], $book['href'], $book['options']);
     }
-    $item_list = array('#theme' => 'item_list' , '#items' => $book_list);
-    return drupal_render($item_list);
+
+    return theme('item_list', array('items' => $book_list));
   }
 
 }
diff --git a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
index 8cacc04..fd48f7d 100644
--- a/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
+++ b/core/modules/book/lib/Drupal/book/Plugin/Block/BookNavigationBlock.php
@@ -107,9 +107,8 @@ public function build() {
         $data = array_shift($tree);
         $below = menu_tree_output($data['below']);
         if (!empty($below)) {
-          $book_title_link = array('#theme' => 'book_title_link', '#link' => $data['link']);
           return array(
-            '#title' => drupal_render($book_title_link),
+            '#title' => theme('book_title_link', array('link' => $data['link'])),
             $below,
           );
         }
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index 32b9df0..0a53e5d 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -373,14 +373,7 @@ function theme_datetime_wrapper($variables) {
   $output = '';
 
   // If the element is required, a required marker is appended to the label.
-  $required = '';
-  if(!empty($element['#required'])) {
-    $form_required_marker = array(
-      '#theme' => 'form_required_marker',
-      '#element' => $element,
-    );
-    $required = drupal_render($form_required_marker);
-  }
+  $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : '';
 
   if (!empty($element['#title'])) {
     $output .= '<h4 class="label">' . t('!title!required', array('!title' => $element['#title'], '!required' => $required)) . '</h4>';
diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index 5608b6b..484ca31 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -107,7 +107,7 @@ function entity_reference_field_is_empty($item, $field) {
  */
 function entity_reference_field_presave(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   foreach ($items as $delta => $item) {
-    if (empty($item['target_id']) && !empty($item['entity']) && $item['entity']->isNew()) {
+    if (empty($item['target_id']) && !empty($item['entity']) &&$item['entity']->isNew()) {
       $item['entity']->save();
       $items[$delta]['target_id'] = $item['entity']->id();
     }
diff --git a/core/modules/field/config/schema/field.schema.yml b/core/modules/field/config/schema/field.schema.yml
index 1b23198..51cfc8f 100644
--- a/core/modules/field/config/schema/field.schema.yml
+++ b/core/modules/field/config/schema/field.schema.yml
@@ -123,6 +123,21 @@ field.instance.*.*.*:
       label: 'Default value funtion'
     settings:
       type: field.[%parent.field_type].instance_settings
+    widget:
+      type: mapping
+      label: 'Widget'
+      mapping:
+        weight:
+          type: integer
+          label: 'Weight'
+        type:
+          type: string
+          label: 'Widget type'
+        settings:
+          type: field_widget.[%parent.type].settings
+        module:
+          type: string
+          label: 'Module'
     field_type:
       type: string
       label: 'Field type'
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
index 8b645f7..bd6ae23 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
@@ -112,6 +112,188 @@ function testLineBreakFilter() {
     }
   }
 
+  /**
+   * Tests limiting allowed tags and XSS prevention.
+   *
+   * XSS tests assume that script is disallowed by default and src is allowed
+   * by default, but on* and style attributes are disallowed.
+   *
+   * Script injection vectors mostly adopted from http://ha.ckers.org/xss.html.
+   *
+   * Relevant CVEs:
+   * - CVE-2002-1806, ~CVE-2005-0682, ~CVE-2005-2106, CVE-2005-3973,
+   *   CVE-2006-1226 (= rev. 1.112?), CVE-2008-0273, CVE-2008-3740.
+   */
+  function testFilterXSS() {
+    // Tag stripping, different ways to work around removal of HTML tags.
+    $f = filter_xss('<script>alert(0)</script>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping -- simple script without special characters.');
+
+    $f = filter_xss('<script src="http://www.example.com" />');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping -- empty script with source.');
+
+    $f = filter_xss('<ScRipt sRc=http://www.example.com/>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- varying case.');
+
+    $f = filter_xss("<script\nsrc\n=\nhttp://www.example.com/\n>");
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- multiline tag.');
+
+    $f = filter_xss('<script/a src=http://www.example.com/a.js></script>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- non whitespace character after tag name.');
+
+    $f = filter_xss('<script/src=http://www.example.com/a.js></script>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- no space between tag and attribute.');
+
+    // Null between < and tag name works at least with IE6.
+    $f = filter_xss("<\0scr\0ipt>alert(0)</script>");
+    $this->assertNoNormalized($f, 'ipt', 'HTML tag stripping evasion -- breaking HTML with nulls.');
+
+    $f = filter_xss("<scrscriptipt src=http://www.example.com/a.js>");
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- filter just removing "script".');
+
+    $f = filter_xss('<<script>alert(0);//<</script>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- double opening brackets.');
+
+    $f = filter_xss('<script src=http://www.example.com/a.js?<b>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- no closing tag.');
+
+    // DRUPAL-SA-2008-047: This doesn't seem exploitable, but the filter should
+    // work consistently.
+    $f = filter_xss('<script>>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- double closing tag.');
+
+    $f = filter_xss('<script src=//www.example.com/.a>');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- no scheme or ending slash.');
+
+    $f = filter_xss('<script src=http://www.example.com/.a');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- no closing bracket.');
+
+    $f = filter_xss('<script src=http://www.example.com/ <');
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- opening instead of closing bracket.');
+
+    $f = filter_xss('<nosuchtag attribute="newScriptInjectionVector">');
+    $this->assertNoNormalized($f, 'nosuchtag', 'HTML tag stripping evasion -- unknown tag.');
+
+    $f = filter_xss('<?xml:namespace ns="urn:schemas-microsoft-com:time">');
+    $this->assertTrue(stripos($f, '<?xml') === FALSE, 'HTML tag stripping evasion -- starting with a question sign (processing instructions).');
+
+    $f = filter_xss('<t:set attributeName="innerHTML" to="&lt;script defer&gt;alert(0)&lt;/script&gt;">');
+    $this->assertNoNormalized($f, 't:set', 'HTML tag stripping evasion -- colon in the tag name (namespaces\' tricks).');
+
+    $f = filter_xss('<img """><script>alert(0)</script>', array('img'));
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- a malformed image tag.');
+
+    $f = filter_xss('<blockquote><script>alert(0)</script></blockquote>', array('blockquote'));
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- script in a blockqoute.');
+
+    $f = filter_xss("<!--[if true]><script>alert(0)</script><![endif]-->");
+    $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- script within a comment.');
+
+    // Dangerous attributes removal.
+    $f = filter_xss('<p onmouseover="http://www.example.com/">', array('p'));
+    $this->assertNoNormalized($f, 'onmouseover', 'HTML filter attributes removal -- events, no evasion.');
+
+    $f = filter_xss('<li style="list-style-image: url(javascript:alert(0))">', array('li'));
+    $this->assertNoNormalized($f, 'style', 'HTML filter attributes removal -- style, no evasion.');
+
+    $f = filter_xss('<img onerror   =alert(0)>', array('img'));
+    $this->assertNoNormalized($f, 'onerror', 'HTML filter attributes removal evasion -- spaces before equals sign.');
+
+    $f = filter_xss('<img onabort!#$%&()*~+-_.,:;?@[/|\]^`=alert(0)>', array('img'));
+    $this->assertNoNormalized($f, 'onabort', 'HTML filter attributes removal evasion -- non alphanumeric characters before equals sign.');
+
+    $f = filter_xss('<img oNmediAError=alert(0)>', array('img'));
+    $this->assertNoNormalized($f, 'onmediaerror', 'HTML filter attributes removal evasion -- varying case.');
+
+    // Works at least with IE6.
+    $f = filter_xss("<img o\0nfocus\0=alert(0)>", array('img'));
+    $this->assertNoNormalized($f, 'focus', 'HTML filter attributes removal evasion -- breaking with nulls.');
+
+    // Only whitelisted scheme names allowed in attributes.
+    $f = filter_xss('<img src="javascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- no evasion.');
+
+    $f = filter_xss('<img src=javascript:alert(0)>', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- no quotes.');
+
+    // A bit like CVE-2006-0070.
+    $f = filter_xss('<img src="javascript:confirm(0)">', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- no alert ;)');
+
+    $f = filter_xss('<img src=`javascript:alert(0)`>', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- grave accents.');
+
+    $f = filter_xss('<img dynsrc="javascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- rare attribute.');
+
+    $f = filter_xss('<table background="javascript:alert(0)">', array('table'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- another tag.');
+
+    $f = filter_xss('<base href="javascript:alert(0);//">', array('base'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- one more attribute and tag.');
+
+    $f = filter_xss('<img src="jaVaSCriPt:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- varying case.');
+
+    $f = filter_xss('<img src=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#48;&#41;>', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- UTF-8 decimal encoding.');
+
+    $f = filter_xss('<img src=&#00000106&#0000097&#00000118&#0000097&#00000115&#0000099&#00000114&#00000105&#00000112&#00000116&#0000058&#0000097&#00000108&#00000101&#00000114&#00000116&#0000040&#0000048&#0000041>', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- long UTF-8 encoding.');
+
+    $f = filter_xss('<img src=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x30&#x29>', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- UTF-8 hex encoding.');
+
+    $f = filter_xss("<img src=\"jav\tascript:alert(0)\">", array('img'));
+    $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an embedded tab.');
+
+    $f = filter_xss('<img src="jav&#x09;ascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded tab.');
+
+    $f = filter_xss('<img src="jav&#x000000A;ascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded newline.');
+
+    // With &#xD; this test would fail, but the entity gets turned into
+    // &amp;#xD;, so it's OK.
+    $f = filter_xss('<img src="jav&#x0D;ascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded carriage return.');
+
+    $f = filter_xss("<img src=\"\n\n\nj\na\nva\ns\ncript:alert(0)\">", array('img'));
+    $this->assertNoNormalized($f, 'cript', 'HTML scheme clearing evasion -- broken into many lines.');
+
+    $f = filter_xss("<img src=\"jav\0a\0\0cript:alert(0)\">", array('img'));
+    $this->assertNoNormalized($f, 'cript', 'HTML scheme clearing evasion -- embedded nulls.');
+
+    $f = filter_xss('<img src=" &#14;  javascript:alert(0)">', array('img'));
+    $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- spaces and metacharacters before scheme.');
+
+    $f = filter_xss('<img src="vbscript:msgbox(0)">', array('img'));
+    $this->assertNoNormalized($f, 'vbscript', 'HTML scheme clearing evasion -- another scheme.');
+
+    $f = filter_xss('<img src="nosuchscheme:notice(0)">', array('img'));
+    $this->assertNoNormalized($f, 'nosuchscheme', 'HTML scheme clearing evasion -- unknown scheme.');
+
+    // Netscape 4.x javascript entities.
+    $f = filter_xss('<br size="&{alert(0)}">', array('br'));
+    $this->assertNoNormalized($f, 'alert', 'Netscape 4.x javascript entities.');
+
+    // DRUPAL-SA-2008-006: Invalid UTF-8, these only work as reflected XSS with
+    // Internet Explorer 6.
+    $f = filter_xss("<p arg=\"\xe0\">\" style=\"background-image: url(javascript:alert(0));\"\xe0<p>", array('p'));
+    $this->assertNoNormalized($f, 'style', 'HTML filter -- invalid UTF-8.');
+
+    $f = filter_xss("\xc0aaa");
+    $this->assertEqual($f, '', 'HTML filter -- overlong UTF-8 sequences.');
+
+    $f = filter_xss("Who&#039;s Online");
+    $this->assertNormalized($f, "who's online", 'HTML filter -- html entity number');
+
+    $f = filter_xss("Who&amp;#039;s Online");
+    $this->assertNormalized($f, "who&#039;s online", 'HTML filter -- encoded html entity number');
+
+    $f = filter_xss("Who&amp;amp;#039; Online");
+    $this->assertNormalized($f, "who&amp;#039; online", 'HTML filter -- double encoded html entity number');
+  }
 
   /**
    * Tests filter settings, defaults, access restrictions and similar.
@@ -201,6 +383,21 @@ function testNoFollowFilter() {
   }
 
   /**
+   * Tests the loose, admin HTML filter.
+   */
+  function testFilterXSSAdmin() {
+    // DRUPAL-SA-2008-044
+    $f = filter_xss_admin('<object />');
+    $this->assertNoNormalized($f, 'object', 'Admin HTML filter -- should not allow object tag.');
+
+    $f = filter_xss_admin('<script />');
+    $this->assertNoNormalized($f, 'script', 'Admin HTML filter -- should not allow script tag.');
+
+    $f = filter_xss_admin('<style /><iframe /><frame /><frameset /><meta /><link /><embed /><applet /><param /><layer />');
+    $this->assertEqual($f, '', 'Admin HTML filter -- should never allow some tags.');
+  }
+
+  /**
    * Tests the HTML escaping filter.
    *
    * check_plain() is not tested here.
diff --git a/core/modules/menu/menu.admin.inc b/core/modules/menu/menu.admin.inc
index 78a43bd..f08ddbd 100644
--- a/core/modules/menu/menu.admin.inc
+++ b/core/modules/menu/menu.admin.inc
@@ -288,13 +288,8 @@ function theme_menu_overview_form($variables) {
       // Change the parent field to a hidden. This allows any value but hides the field.
       $element['plid']['#type'] = 'hidden';
 
-      $indent = array(
-        '#theme' => 'indentation',
-        '#size' => $element['#item']['depth'] - 1,
-      );
-
       $row = array();
-      $row[] = drupal_render($indent) . drupal_render($element['title']);
+      $row[] = theme('indentation', array('size' => $element['#item']['depth'] - 1)) . drupal_render($element['title']);
       $row[] = array('data' => drupal_render($element['hidden']), 'class' => array('checkbox', 'menu-enabled'));
       $row[] = drupal_render($element['weight']) . drupal_render($element['plid']) . drupal_render($element['mlid']);
       $row[] = drupal_render($element['operations']);
@@ -308,18 +303,8 @@ function theme_menu_overview_form($variables) {
   if (empty($rows)) {
     $rows[] = array(array('data' => $form['#empty_text'], 'colspan' => '7'));
   }
-
-  $table = array(
-    '#theme' => 'table',
-    '#header' => $header,
-    '#rows' => $rows,
-    '#attributes' => array(
-      'id' => 'menu-overview',
-    ),
-  );
-
   $output .= drupal_render($form['inline_actions']);
-  $output .= drupal_render($table);
+  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'menu-overview')));
   $output .= drupal_render_children($form);
   return $output;
 }
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index 2884761..14c41b0 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -358,9 +358,8 @@ function menu_parent_options(array $menus, MenuLink $menu_link = NULL, $type = N
  */
 function menu_parent_options_js() {
   $available_menus = array();
-  $menus = Drupal::request()->request->get('menus');
-  if (count($menus)) {
-    foreach ($menus as $menu) {
+  if (isset($_POST['menus']) && count($_POST['menus'])) {
+    foreach ($_POST['menus'] as $menu) {
       $available_menus[$menu] = $menu;
     }
   }
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index bdd5801..195a2ba 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -470,10 +470,9 @@ public function save(array $form, array &$form_state) {
    */
   public function delete(array $form, array &$form_state) {
     $destination = array();
-    $query = \Drupal::request()->query;
-    if ($query->has('destination')) {
+    if (isset($_GET['destination'])) {
       $destination = drupal_get_destination();
-      $query->remove('destination');
+      unset($_GET['destination']);
     }
     $node = $this->entity;
     $form_state['redirect'] = array('node/' . $node->nid . '/delete', array('query' => $destination));
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 3245f24..ef9fd7f 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1085,7 +1085,7 @@ function template_preprocess_node(&$variables) {
   $username = array(
     '#theme' => 'username',
     '#account' => $node,
-    '#link_options' => array('attributes' => array('rel' => 'author')),
+    '#link_attributes' => array('rel' => 'author'),
   );
   $variables['name'] = drupal_render($username);
 
diff --git a/core/modules/options/config/schema/options.schema.yml b/core/modules/options/config/schema/options.schema.yml
index d406d76..b63ba85 100644
--- a/core/modules/options/config/schema/options.schema.yml
+++ b/core/modules/options/config/schema/options.schema.yml
@@ -131,3 +131,32 @@ field.list_boolean.value:
         value:
           type: boolean
           label: 'Value'
+
+field_widget.options_select.settings:
+  type: sequence
+  label: 'Select list widget settings'
+  sequence:
+    - type: string
+      label: 'Value'
+
+field_widget.options_buttons.settings:
+  type: sequence
+  label: 'Check boxes/radio buttons widget settings'
+  sequence:
+    - type: string
+      label: 'Value'
+
+field_widget.options_onoff.settings:
+  type: mapping
+  label: 'Single on/off checkbox widget settings'
+  mapping:
+    display_label:
+      type: boolean
+      label: 'Use field label instead of the "On value" as label'
+
+field_widget.options_list.settings:
+  type: sequence
+  label: 'Select list widget settings'
+  sequence:
+    - type: string
+      label: 'Value'
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index 1aca778..930c1df 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -204,10 +204,9 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
  */
 function path_admin_form_delete_submit($form, &$form_state) {
   $destination = array();
-  $query = Drupal::request()->query;
-  if ($query->has('destination')) {
+  if (isset($_GET['destination'])) {
     $destination = drupal_get_destination();
-    $query->remove('destination');
+    unset($_GET['destination']);
   }
   $form_state['redirect'] = array('admin/config/search/path/delete/' . $form_state['values']['pid'], array('query' => $destination));
 }
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index f1eb7e7..535497a 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -647,14 +647,13 @@ function rdf_preprocess_user(&$variables) {
  * Implements hook_preprocess_HOOK() for theme_username().
  */
 function rdf_preprocess_username(&$variables) {
-  $attributes = array();
   // Because lang is set on the HTML element that wraps the page, the
   // username inherits this language attribute. However, since the username
   // might not be transliterated to the same language that the content is in,
   // we do not want it to inherit the language attribute, so we set the
   // attribute to an empty string.
   if (empty($variables['attributes']['lang'])) {
-    $attributes['lang'] = '';
+    $variables['attributes']['lang'] = '';
   }
 
   // $variables['account'] is a pseudo account object, and as such, does not
@@ -673,9 +672,10 @@ function rdf_preprocess_username(&$variables) {
   // a user profile URI for it (only a homepage which cannot be used as user
   // profile in RDF.)
   if ($variables['uid'] > 0) {
-    $attributes['about'] = url('user/' . $variables['uid']);
+    $variables['attributes']['about'] = url('user/' . $variables['uid']);
   }
 
+  $attributes = array();
   // The typeof attribute specifies the RDF type(s) of this resource. They
   // are defined in the 'rdftype' property of the user RDF mapping.
   if (!empty($rdf_mapping['rdftype'])) {
@@ -696,14 +696,8 @@ function rdf_preprocess_username(&$variables) {
   // separating the values in the RDFa attributes
   // (see http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes).
   // Therefore, merge rather than override so as not to clobber values set by
-  // earlier preprocess functions. These attributes will be placed in the a
-  // element if a link is rendered, or on a span element otherwise.
-  if (isset($variables['link_path'])) {
-    $variables['link_options']['attributes'] = array_merge_recursive($variables['link_options']['attributes'], $attributes);
-  }
-  else {
-    $variables['attributes'] = array_merge_recursive($variables['attributes'], $attributes);
-  }
+  // earlier preprocess functions.
+  $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $attributes);
 }
 
 /**
diff --git a/core/modules/serialization/lib/Drupal/serialization/Tests/SerializationTest.php b/core/modules/serialization/lib/Drupal/serialization/Tests/SerializationTest.php
index 9dee10a..e0c62cd 100644
--- a/core/modules/serialization/lib/Drupal/serialization/Tests/SerializationTest.php
+++ b/core/modules/serialization/lib/Drupal/serialization/Tests/SerializationTest.php
@@ -36,7 +36,7 @@ public static function getInfo() {
 
   protected function setUp() {
     parent::setUp();
-    $this->serializer = $this->container->get('serializer');
+    $this->serializer = drupal_container()->get('serializer');
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php
new file mode 100644
index 0000000..7b5305d
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AttributesUnitTest.php
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Common\AttributesUnitTest.
+ */
+
+namespace Drupal\system\Tests\Common;
+
+use Drupal\Core\Template\Attribute;
+use Drupal\simpletest\UnitTestBase;
+
+/**
+ * Tests the Drupal\Core\Template\Attribute functionality.
+ */
+class AttributesUnitTest extends UnitTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'HTML Attributes',
+      'description' => 'Tests the Drupal\Core\Template\Attribute functionality.',
+      'group' => 'Common',
+    );
+  }
+
+  /**
+   * Tests that drupal_html_class() cleans the class name properly.
+   */
+  function testDrupalAttributes() {
+    // Verify that special characters are HTML encoded.
+    $this->assertIdentical((string) new Attribute(array('title' => '&"\'<>')), ' title="&amp;&quot;&#039;&lt;&gt;"', 'HTML encode attribute values.');
+
+    // Verify multi-value attributes are concatenated with spaces.
+    $attributes = array('class' => array('first', 'last'));
+    $this->assertIdentical((string) new Attribute(array('class' => array('first', 'last'))), ' class="first last"', 'Concatenate multi-value attributes.');
+
+    // Verify empty attribute values are rendered.
+    $this->assertIdentical((string) new Attribute(array('alt' => '')), ' alt=""', 'Empty attribute value #1.');
+    $this->assertIdentical((string) new Attribute(array('alt' => NULL)), ' alt=""', 'Empty attribute value #2.');
+
+    // Verify multiple attributes are rendered.
+    $attributes = array(
+      'id' => 'id-test',
+      'class' => array('first', 'last'),
+      'alt' => 'Alternate',
+    );
+    $this->assertIdentical((string) new Attribute($attributes), ' id="id-test" class="first last" alt="Alternate"', 'Multiple attributes.');
+
+    // Verify empty attributes array is rendered.
+    $this->assertIdentical((string) new Attribute(array()), '', 'Empty attributes array.');
+
+    $attribute = new Attribute(array('key1' => 'value1'));
+    foreach($attribute as $value) {
+      $this->assertIdentical((string) $value, 'value1', 'Iterate over attribute.');
+    }
+  }
+}
diff --git a/core/tests/Drupal/Tests/Core/Common/TagsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AutocompleteTagsUnitTest.php
similarity index 60%
rename from core/tests/Drupal/Tests/Core/Common/TagsTest.php
rename to core/modules/system/lib/Drupal/system/Tests/Common/AutocompleteTagsUnitTest.php
index 7106d73..8240536 100644
--- a/core/tests/Drupal/Tests/Core/Common/TagsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AutocompleteTagsUnitTest.php
@@ -2,20 +2,18 @@
 
 /**
  * @file
- * Contains \Drupal\Tests\Core\Common\TagsTest.
+ * Definition of Drupal\system\Tests\Common\AutocompleteTagsUnitTest.
  */
 
-namespace Drupal\Tests\Core\Common;
+namespace Drupal\system\Tests\Common;
 
-use Drupal\Component\Utility\Tags;
-use Drupal\Tests\UnitTestCase;
+use Drupal\simpletest\UnitTestBase;
 
 /**
- * Tests Tags::explodeTags and Tags::implodeTags().
+ * Tests drupal_explode_tags() and drupal_implode_tags().
  */
-class TagsTest extends UnitTestCase {
-
-  protected $validTags = array(
+class AutocompleteTagsUnitTest extends UnitTestBase {
+  var $validTags = array(
     'Drupal' => 'Drupal',
     'Drupal with some spaces' => 'Drupal with some spaces',
     '"Legendary Drupal mascot of doom: ""Druplicon"""' => 'Legendary Drupal mascot of doom: "Druplicon"',
@@ -33,21 +31,21 @@ public static function getInfo() {
   /**
    * Explodes a series of tags.
    */
-  public function explodeTags() {
+  function testDrupalExplodeTags() {
     $string = implode(', ', array_keys($this->validTags));
-    $tags = Tags::explode($string);
+    $tags = drupal_explode_tags($string);
     $this->assertTags($tags);
   }
 
   /**
    * Implodes a series of tags.
    */
-  public function testImplodeTags() {
+  function testDrupalImplodeTags() {
     $tags = array_values($this->validTags);
     // Let's explode and implode to our heart's content.
     for ($i = 0; $i < 10; $i++) {
-      $string = Tags::implode($tags);
-      $tags = Tags::explode($string);
+      $string = drupal_implode_tags($tags);
+      $tags = drupal_explode_tags($string);
     }
     $this->assertTags($tags);
   }
@@ -55,16 +53,15 @@ public function testImplodeTags() {
   /**
    * Helper function: asserts that the ending array of tags is what we wanted.
    */
-  protected function assertTags($tags) {
+  function assertTags($tags) {
     $original = $this->validTags;
     foreach ($tags as $tag) {
       $key = array_search($tag, $original);
-      $this->assertTrue((bool) $key, $tag, sprintf('Make sure tag %s shows up in the final tags array (originally %s)', $tag, $key));
+      $this->assertTrue($key, format_string('Make sure tag %tag shows up in the final tags array (originally %original)', array('%tag' => $tag, '%original' => $key)));
       unset($original[$key]);
     }
     foreach ($original as $leftover) {
-      $this->fail(sprintf('Leftover tag %s was left over.', $leftover));
+      $this->fail(format_string('Leftover tag %leftover was left over.', array('%leftover' => $leftover)));
     }
   }
-
 }
diff --git a/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/DiffArrayUnitTest.php
similarity index 85%
rename from core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php
rename to core/modules/system/lib/Drupal/system/Tests/Common/DiffArrayUnitTest.php
index b4fc6c3..a5ae7d2 100644
--- a/core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/DiffArrayUnitTest.php
@@ -2,18 +2,18 @@
 
 /**
  * @file
- * Contains \Drupal\Tests\Core\Common\DiffArrayTest.
+ * Contains \Drupal\system\Tests\Common\DiffArrayUnitTest.
  */
 
-namespace Drupal\Tests\Core\Common;
+namespace Drupal\system\Tests\Common;
 
 use Drupal\Component\Utility\DiffArray;
-use Drupal\Tests\UnitTestCase;
+use Drupal\simpletest\UnitTestBase;
 
 /**
  * Tests the DiffArray helper class.
  */
-class DiffArrayTest extends UnitTestCase {
+class DiffArrayUnitTest extends UnitTestBase {
 
   /**
    * Array to use for testing.
@@ -77,7 +77,7 @@ public function testDiffAssocRecursive() {
       'new' => 'new',
     );
 
-    $this->assertSame(DiffArray::diffAssocRecursive($this->array1, $this->array2), $expected);
+    $this->assertIdentical(DiffArray::diffAssocRecursive($this->array1, $this->array2), $expected);
   }
 
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/ValidUrlUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/ValidUrlUnitTest.php
new file mode 100644
index 0000000..6750d27
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/ValidUrlUnitTest.php
@@ -0,0 +1,118 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Common\ValidUrlUnitTest.
+ */
+
+namespace Drupal\system\Tests\Common;
+
+use Drupal\simpletest\UnitTestBase;
+
+/**
+ * Tests URL validation by valid_url().
+ */
+class ValidUrlUnitTest extends UnitTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'URL validation',
+      'description' => 'Tests URL validation by valid_url()',
+      'group' => 'Common',
+    );
+  }
+
+  /**
+   * Tests valid absolute URLs.
+   */
+  function testValidAbsolute() {
+    $url_schemes = array('http', 'https', 'ftp');
+    $valid_absolute_urls = array(
+      'example.com',
+      'www.example.com',
+      'ex-ample.com',
+      '3xampl3.com',
+      'example.com/paren(the)sis',
+      'example.com/index.html#pagetop',
+      'example.com:8080',
+      'subdomain.example.com',
+      'example.com/index.php/node',
+      'example.com/index.php/node?param=false',
+      'user@www.example.com',
+      'user:pass@www.example.com:8080/login.php?do=login&style=%23#pagetop',
+      '127.0.0.1',
+      'example.org?',
+      'john%20doe:secret:foo@example.org/',
+      'example.org/~,$\'*;',
+      'caf%C3%A9.example.org',
+      '[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html',
+    );
+
+    foreach ($url_schemes as $scheme) {
+      foreach ($valid_absolute_urls as $url) {
+        $test_url = $scheme . '://' . $url;
+        $valid_url = valid_url($test_url, TRUE);
+        $this->assertTrue($valid_url, format_string('@url is a valid URL.', array('@url' => $test_url)));
+      }
+    }
+  }
+
+  /**
+   * Tests invalid absolute URLs.
+   */
+  function testInvalidAbsolute() {
+    $url_schemes = array('http', 'https', 'ftp');
+    $invalid_ablosule_urls = array(
+      '',
+      'ex!ample.com',
+      'ex%ample.com',
+    );
+
+    foreach ($url_schemes as $scheme) {
+      foreach ($invalid_ablosule_urls as $url) {
+        $test_url = $scheme . '://' . $url;
+        $valid_url = valid_url($test_url, TRUE);
+        $this->assertFalse($valid_url, format_string('@url is NOT a valid URL.', array('@url' => $test_url)));
+      }
+    }
+  }
+
+  /**
+   * Tests valid relative URLs.
+   */
+  function testValidRelative() {
+    $valid_relative_urls = array(
+      'paren(the)sis',
+      'index.html#pagetop',
+      'index.php/node',
+      'index.php/node?param=false',
+      'login.php?do=login&style=%23#pagetop',
+    );
+
+    foreach (array('', '/') as $front) {
+      foreach ($valid_relative_urls as $url) {
+        $test_url = $front . $url;
+        $valid_url = valid_url($test_url);
+        $this->assertTrue($valid_url, format_string('@url is a valid URL.', array('@url' => $test_url)));
+      }
+    }
+  }
+
+  /**
+   * Tests invalid relative URLs.
+   */
+  function testInvalidRelative() {
+    $invalid_relative_urls = array(
+      'ex^mple',
+      'example<>',
+      'ex%ample',
+    );
+
+    foreach (array('', '/') as $front) {
+      foreach ($invalid_relative_urls as $url) {
+        $test_url = $front . $url;
+        $valid_url = valid_url($test_url);
+        $this->assertFALSE($valid_url, format_string('@url is NOT a valid URL.', array('@url' => $test_url)));
+      }
+    }
+  }
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
index 433d145..57863ff 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
@@ -35,6 +35,16 @@ protected function setUp() {
   }
 
   /**
+   * Checks that invalid multi-byte sequences are rejected.
+   */
+  function testInvalidMultiByte() {
+     $text = filter_xss("Foo\xC0barbaz");
+     $this->assertEqual($text, '', 'filter_xss() rejects invalid sequence "Foo\xC0barbaz"');
+     $text = filter_xss("Fooÿñ");
+     $this->assertEqual($text, "Fooÿñ", 'filter_xss() accepts valid sequence Fooÿñ');
+  }
+
+  /**
    * Tests t() functionality.
    */
   function testT() {
diff --git a/core/modules/text/config/schema/text.schema.yml b/core/modules/text/config/schema/text.schema.yml
index 9df1b38..0dd0cf9 100644
--- a/core/modules/text/config/schema/text.schema.yml
+++ b/core/modules/text/config/schema/text.schema.yml
@@ -108,3 +108,39 @@ field.text_with_summary.value:
         format:
           type: string
           label: 'Text format'
+
+field_widget.text_textfield.settings:
+  type: mapping
+  label: 'Text field widget settings'
+  mapping:
+    size:
+      type: integer
+      label: 'Size of textfield'
+    placeholder:
+      type: label
+      label: 'Placeholder'
+
+field_widget.text_textarea.settings:
+  type: mapping
+  label: 'Long text widget settings'
+  mapping:
+    rows:
+      type: integer
+      label: 'Rows'
+    placeholder:
+      type: label
+      label: 'Placeholder'
+
+field_widget.text_textarea_with_summary.settings:
+  type: mapping
+  label: 'Text area widget settings'
+  mapping:
+    rows:
+      type: integer
+      label: 'Rows'
+    summary_rows:
+      type: integer
+      label: 'Summary rows'
+    placeholder:
+      type: label
+      label: 'Placeholder'
diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module
index 115be1a..6d0c1ea 100644
--- a/core/modules/translation/translation.module
+++ b/core/modules/translation/translation.module
@@ -122,12 +122,9 @@ function translation_permission() {
  * Implements hook_node_access().
  */
 function translation_node_access($node, $op, $account, $langcode) {
-  $query = Drupal::request()->query;
-  $translation = $query->get('translation');
-  $target = $query->get('target');
-  $request_has_translation_arg = !empty($translation) && !empty($target) && is_numeric($translation);
+  $request_has_translation_arg = isset($_GET['translation']) && isset($_GET['target']) && is_numeric($_GET['translation']);
   if ($op == 'create' && $request_has_translation_arg) {
-    $source_node = node_load($translation);
+    $source_node = node_load($_GET['translation']);
     if (empty($source_node) || !translation_user_can_translate_node($source_node, $account)){
       return NODE_ACCESS_DENY;
     }
@@ -307,22 +304,19 @@ function translation_node_view(EntityInterface $node, EntityDisplay $display, $v
  * Implements hook_node_prepare().
  */
 function translation_node_prepare(EntityInterface $node) {
-  $query = Drupal::request()->query;
-  $translation = $query->get('translation');
-  $target = $query->get('target');
   // Only act if we are dealing with a content type supporting translations.
   if (translation_supported_type($node->type) &&
     // And it's a new node.
     empty($node->nid) &&
-    // And the request variables are set properly.
-    !empty($translation) &&
-    !empty($target) &&
-    is_numeric($translation)) {
+    // And the $_GET variables are set properly.
+    isset($_GET['translation']) &&
+    isset($_GET['target']) &&
+    is_numeric($_GET['translation'])) {
 
-    $source_node = node_load($translation);
+    $source_node = node_load($_GET['translation']);
 
     $language_list = language_list();
-    $langcode = $target;
+    $langcode = $_GET['target'];
     if (!isset($language_list[$langcode]) || ($source_node->langcode == $langcode)) {
       // If not supported language, or same language as source node, break.
       return;
diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php b/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php
index 39d1a21..9ab78d7 100644
--- a/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php
+++ b/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManager;
 use Drupal\Core\Entity\EntityNG;
+use Drupal\Core\Entity\Field\FieldInterface;
 
 /**
  * Provides field translation synchronization capabilities.
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index be55248..9663af5 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -739,7 +739,6 @@ function template_preprocess_username(&$variables) {
   }
 
   $variables['extra'] = '';
-  $variables['attributes'] = array();
   if (empty($account->uid)) {
    $variables['uid'] = 0;
    if (theme_get_setting('features.comment_user_verification')) {
@@ -765,21 +764,45 @@ function template_preprocess_username(&$variables) {
   // Populate link path and attributes if appropriate.
   if ($variables['uid'] && $variables['profile_access']) {
     // We are linking to a local user.
-    $variables['link_options']['attributes']['title'] = t('View user profile.');
+    $variables['link_attributes']['title'] = t('View user profile.');
     $variables['link_path'] = 'user/' . $variables['uid'];
   }
   elseif (!empty($account->homepage)) {
     // Like the 'class' attribute, the 'rel' attribute can hold a
     // space-separated set of values, so initialize it as an array to make it
     // easier for other preprocess functions to append to it.
-    $variables['link_options']['attributes']['rel'] = 'nofollow';
+    $variables['link_attributes']['rel'] = 'nofollow';
     $variables['link_path'] = $account->homepage;
     $variables['homepage'] = $account->homepage;
   }
   // We do not want the l() function to check_plain() a second time.
   $variables['link_options']['html'] = TRUE;
   // Set a default class.
-  $variables['link_options']['attributes']['class'] = array('username');
+  $variables['attributes'] = array('class' => array('username'));
+}
+
+/**
+ * Processes variables for theme_username().
+ *
+ * @see template_preprocess_username()
+ */
+function template_process_username(&$variables) {
+  // Finalize the link_options array for passing to the l() function.
+  // This is done in the process phase so that attributes may be added by
+  // modules or the theme during the preprocess phase.
+  if (isset($variables['link_path'])) {
+    // $variables['attributes'] contains attributes that should be applied
+    // regardless of whether a link is being rendered or not.
+    // $variables['link_attributes'] contains attributes that should only be
+    // applied if a link is being rendered. Preprocess functions are encouraged
+    // to use the former unless they want to add attributes on the link only.
+    // If a link is being rendered, these need to be merged. Some attributes are
+    // themselves arrays, so the merging needs to be recursive.
+    // This purposefully does not use
+    // \Drupal\Component\Utility\NestedArray::mergeDeep() for performance
+    // reasons, since it is potentially called very often.
+    $variables['link_options']['attributes'] = array_merge_recursive($variables['link_attributes'], $variables['attributes']);
+  }
 }
 
 /**
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index fa54097..d5368ea 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -726,7 +726,7 @@ function template_preprocess_views_view_table(&$vars) {
   if (empty($vars['rows']) && !empty($options['empty_table'])) {
     $build = $view->display_handler->renderArea('empty');
     $vars['rows'][0][0] = drupal_render($build);
-    $vars['row_classes'][0] = new Attribute(array('class' => 'odd'));
+    $vars['row_classes'][0] = new Attribute();
     // Calculate the amounts of rows with output.
     $vars['field_classes'][0][0] = new Attribute(array(
       'colspan' => count($vars['header']),
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php b/core/modules/views_ui/lib/Drupal/views_ui/Routing/ViewsUIController.php
similarity index 97%
rename from core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php
rename to core/modules/views_ui/lib/Drupal/views_ui/Routing/ViewsUIController.php
index 424aa29..cf79f57 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Controller/ViewsUIController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Routing/ViewsUIController.php
@@ -2,10 +2,10 @@
 
 /**
  * @file
- * Contains \Drupal\views_ui\Controller\ViewsUIController.
+ * Contains \Drupal\views_ui\Routing\ViewsUIController.
  */
 
-namespace Drupal\views_ui\Controller;
+namespace Drupal\views_ui\Routing;
 
 use Drupal\views\ViewExecutable;
 use Drupal\views\ViewStorageInterface;
@@ -49,7 +49,7 @@ class ViewsUIController implements ControllerInterface {
   protected $tempStore;
 
   /**
-   * Constructs a new \Drupal\views_ui\Controller\ViewsUIController object.
+   * Constructs a new \Drupal\views_ui\Routing\ViewsUIController object.
    *
    * @param \Drupal\Core\Entity\EntityManager $entity_manager
    *   The Entity manager.
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php
index 4d05a67..b388d41 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/TagTest.php
@@ -8,7 +8,7 @@
 namespace Drupal\views_ui\Tests;
 
 use Drupal\views\Tests\ViewUnitTestBase;
-use Drupal\views_ui\Controller\ViewsUIController;
+use Drupal\views_ui\Routing\ViewsUIController;
 
 /**
  * Tests the views ui tagging functionality.
diff --git a/core/modules/views_ui/views_ui.routing.yml b/core/modules/views_ui/views_ui.routing.yml
index 16eff86..f2046f6 100644
--- a/core/modules/views_ui/views_ui.routing.yml
+++ b/core/modules/views_ui/views_ui.routing.yml
@@ -1,7 +1,7 @@
 views_ui.list:
   pattern: '/admin/structure/views'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::listing'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::listing'
   requirements:
     _permission: 'administer views'
 
@@ -29,21 +29,21 @@ views_ui.settings.advanced:
 views_ui.reports.fields:
   pattern: '/admin/reports/fields/views-fields'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::reportFields'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::reportFields'
   requirements:
     _permission: 'administer views'
 
 views_ui.reports.plugins:
   pattern: '/admin/reports/views-plugins'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::reportPlugins'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::reportPlugins'
   requirements:
     _permission: 'administer views'
 
 views_ui.operation:
   pattern: '/admin/structure/views/view/{view}/{op}'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::ajaxOperation'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::ajaxOperation'
   requirements:
     _permission: 'administer views'
     op: 'enable|disable'
@@ -65,7 +65,7 @@ views_ui.delete:
 views_ui.autocomplete:
   pattern: '/admin/views/ajax/autocomplete/tag'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::autocompleteTag'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::autocompleteTag'
   requirements:
     _permission: 'administer views'
 
@@ -75,7 +75,7 @@ views_ui.edit:
     tempstore:
       view: 'views'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::edit'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::edit'
   requirements:
     _permission: 'administer views'
 
@@ -85,7 +85,7 @@ views_ui.edit.display:
     tempstore:
       view: 'views'
   defaults:
-    _controller: '\Drupal\views_ui\Controller\ViewsUIController::edit'
+    _controller: '\Drupal\views_ui\Routing\ViewsUIController::edit'
     display_id: NULL
   requirements:
     _permission: 'administer views'
diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php
deleted file mode 100644
index e87cd79..0000000
--- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php
+++ /dev/null
@@ -1,567 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Tests\Component\Utility\XssTest.
- */
-
-namespace Drupal\Tests\Component\Utility;
-
-use Drupal\Component\Utility\String;
-use Drupal\Component\Utility\UrlValidator;
-use Drupal\Component\Utility\Xss;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests the Xss utility.
- *
- * Script injection vectors mostly adopted from http://ha.ckers.org/xss.html.
- *
- * Relevant CVEs:
- * - CVE-2002-1806, ~CVE-2005-0682, ~CVE-2005-2106, CVE-2005-3973,
- *   CVE-2006-1226 (= rev. 1.112?), CVE-2008-0273, CVE-2008-3740.
- *
- * @see \Drupal\Component\Utility\Xss
- */
-class XssTest extends UnitTestCase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Xss filter tests',
-      'description' => 'Confirm that Xss::filter() works as expected.',
-      'group' => 'Common',
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    $allowed_protocols = array(
-      'http',
-      'https',
-      'ftp',
-      'news',
-      'nntp',
-      'telnet',
-      'mailto',
-      'irc',
-      'ssh',
-      'sftp',
-      'webcal',
-      'rtsp',
-    );
-    UrlValidator::setAllowedProtocols($allowed_protocols);
-  }
-
-  /**
-   * Tests limiting allowed tags and XSS prevention.
-   *
-   * XSS tests assume that script is disallowed by default and src is allowed
-   * by default, but on* and style attributes are disallowed.
-   *
-   * @param string $value
-   *   The value to filter.
-   * @param string $expected
-   *   The expected result.
-   * @param string $message
-   *   The assertion message to display upon failure.
-   *
-   * @dataProvider providerTestFilterXssNormalized
-   */
-  public function testFilterXssNormalized($value, $expected, $message) {
-    $this->assertNormalized(Xss::filter($value), $expected, $message);
-  }
-
-  /**
-   * Data provider for testFilterXssNormalized().
-   *
-   * @see testFilterXssNormalized()
-   *
-   * @return array
-   *   An array of arrays containing strings:
-   *     - The value to filter.
-   *     - The value to expect after filtering.
-   *     - The assertion message.
-   */
-  public function providerTestFilterXssNormalized() {
-    return array(
-      array(
-        "Who&#039;s Online",
-        "who's online",
-        'HTML filter -- html entity number',
-      ),
-      array(
-        "Who&amp;#039;s Online",
-        "who&#039;s online",
-        'HTML filter -- encoded html entity number',
-      ),
-      array(
-        "Who&amp;amp;#039; Online",
-        "who&amp;#039; online",
-        'HTML filter -- double encoded html entity number',
-      ),
-    );
-  }
-
-  /**
-   * Tests limiting allowed tags and XSS prevention.
-   *
-   * XSS tests assume that script is disallowed by default and src is allowed
-   * by default, but on* and style attributes are disallowed.
-   *
-   * @param string $value
-   *   The value to filter.
-   * @param string $expected
-   *   The expected result.
-   * @param string $message
-   *   The assertion message to display upon failure.
-   * @param array $allowed_tags
-   *   (Optional) The allowed tags to be passed on Xss::filter().
-   *
-   * @dataProvider providerTestFilterXssNotNormalized
-   */
-  public function testFilterXssNotNormalized($value, $expected, $message, array $allowed_tags = NULL) {
-    if ($allowed_tags === NULL) {
-      $value = Xss::filter($value);
-    }
-    else {
-      $value = Xss::filter($value, $allowed_tags);
-    }
-    $this->assertNotNormalized($value, $expected, $message);
-  }
-
-  /**
-   * Data provider for testFilterXssNotNormalized().
-   *
-   * @see testFilterXssNotNormalized()
-   *
-   * @return array
-   *   An array of arrays containing the following elements:
-   *     - The value to filter string.
-   *     - The value to expect after filtering string.
-   *     - The assertion message string.
-   *     - (optional) The allowed html tags array that should be passed to
-   *        Xss::filter().
-   */
-  public function providerTestFilterXssNotNormalized() {
-    $cases = array(
-      // Tag stripping, different ways to work around removal of HTML tags.
-      array(
-        '<script>alert(0)</script>',
-        'script',
-        'HTML tag stripping -- simple script without special characters.',
-      ),
-      array(
-        '<script src="http://www.example.com" />',
-        'script',
-        'HTML tag stripping -- empty script with source.',
-      ),
-      array(
-        '<ScRipt sRc=http://www.example.com/>',
-        'script',
-        'HTML tag stripping evasion -- varying case.',
-      ),
-      array(
-        "<script\nsrc\n=\nhttp://www.example.com/\n>",
-        'script',
-        'HTML tag stripping evasion -- multiline tag.',
-      ),
-      array(
-        '<script/a src=http://www.example.com/a.js></script>',
-        'script',
-        'HTML tag stripping evasion -- non whitespace character after tag name.',
-      ),
-      array(
-        '<script/src=http://www.example.com/a.js></script>',
-        'script',
-        'HTML tag stripping evasion -- no space between tag and attribute.',
-      ),
-      // Null between < and tag name works at least with IE6.
-      array(
-        "<\0scr\0ipt>alert(0)</script>",
-        'ipt',
-        'HTML tag stripping evasion -- breaking HTML with nulls.',
-      ),
-      array(
-        "<scrscriptipt src=http://www.example.com/a.js>",
-        'script',
-        'HTML tag stripping evasion -- filter just removing "script".',
-      ),
-      array(
-        '<<script>alert(0);//<</script>',
-        'script',
-        'HTML tag stripping evasion -- double opening brackets.',
-      ),
-      array(
-        '<script src=http://www.example.com/a.js?<b>',
-        'script',
-        'HTML tag stripping evasion -- no closing tag.',
-      ),
-      // DRUPAL-SA-2008-047: This doesn't seem exploitable, but the filter should
-      // work consistently.
-      array(
-        '<script>>',
-        'script',
-        'HTML tag stripping evasion -- double closing tag.',
-      ),
-      array(
-        '<script src=//www.example.com/.a>',
-        'script',
-        'HTML tag stripping evasion -- no scheme or ending slash.',
-      ),
-      array(
-        '<script src=http://www.example.com/.a',
-        'script',
-        'HTML tag stripping evasion -- no closing bracket.',
-      ),
-      array(
-        '<script src=http://www.example.com/ <',
-        'script',
-        'HTML tag stripping evasion -- opening instead of closing bracket.',
-      ),
-      array(
-        '<nosuchtag attribute="newScriptInjectionVector">',
-        'nosuchtag',
-        'HTML tag stripping evasion -- unknown tag.',
-      ),
-      array(
-        '<t:set attributeName="innerHTML" to="&lt;script defer&gt;alert(0)&lt;/script&gt;">',
-        't:set',
-        'HTML tag stripping evasion -- colon in the tag name (namespaces\' tricks).',
-      ),
-      array(
-        '<img """><script>alert(0)</script>',
-        'script',
-        'HTML tag stripping evasion -- a malformed image tag.',
-        array('img'),
-      ),
-      array(
-        '<blockquote><script>alert(0)</script></blockquote>',
-        'script',
-        'HTML tag stripping evasion -- script in a blockqoute.',
-        array('blockquote'),
-      ),
-      array(
-        "<!--[if true]><script>alert(0)</script><![endif]-->",
-        'script',
-        'HTML tag stripping evasion -- script within a comment.',
-      ),
-      // Dangerous attributes removal.
-      array(
-        '<p onmouseover="http://www.example.com/">',
-        'onmouseover',
-        'HTML filter attributes removal -- events, no evasion.',
-        array('p'),
-      ),
-      array(
-        '<li style="list-style-image: url(javascript:alert(0))">',
-        'style',
-        'HTML filter attributes removal -- style, no evasion.',
-        array('li'),
-      ),
-      array(
-        '<img onerror   =alert(0)>',
-        'onerror',
-        'HTML filter attributes removal evasion -- spaces before equals sign.',
-        array('img'),
-      ),
-      array(
-        '<img onabort!#$%&()*~+-_.,:;?@[/|\]^`=alert(0)>',
-        'onabort',
-        'HTML filter attributes removal evasion -- non alphanumeric characters before equals sign.',
-        array('img'),
-      ),
-      array(
-        '<img oNmediAError=alert(0)>',
-        'onmediaerror',
-        'HTML filter attributes removal evasion -- varying case.',
-        array('img'),
-      ),
-      // Works at least with IE6.
-      array(
-        "<img o\0nfocus\0=alert(0)>",
-        'focus',
-        'HTML filter attributes removal evasion -- breaking with nulls.',
-        array('img'),
-      ),
-      // Only whitelisted scheme names allowed in attributes.
-      array(
-        '<img src="javascript:alert(0)">',
-        'javascript',
-        'HTML scheme clearing -- no evasion.',
-        array('img'),
-      ),
-      array(
-        '<img src=javascript:alert(0)>',
-        'javascript',
-        'HTML scheme clearing evasion -- no quotes.',
-        array('img'),
-      ),
-      // A bit like CVE-2006-0070.
-      array(
-        '<img src="javascript:confirm(0)">',
-        'javascript',
-        'HTML scheme clearing evasion -- no alert ;)',
-        array('img'),
-      ),
-      array(
-        '<img src=`javascript:alert(0)`>',
-        'javascript',
-        'HTML scheme clearing evasion -- grave accents.',
-        array('img'),
-      ),
-      array(
-        '<img dynsrc="javascript:alert(0)">',
-        'javascript',
-        'HTML scheme clearing -- rare attribute.',
-        array('img'),
-      ),
-      array(
-        '<table background="javascript:alert(0)">',
-        'javascript',
-        'HTML scheme clearing -- another tag.',
-        array('table'),
-      ),
-      array(
-        '<base href="javascript:alert(0);//">',
-        'javascript',
-        'HTML scheme clearing -- one more attribute and tag.',
-        array('base'),
-      ),
-      array(
-        '<img src="jaVaSCriPt:alert(0)">',
-        'javascript',
-        'HTML scheme clearing evasion -- varying case.',
-        array('img'),
-      ),
-      array(
-        '<img src=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#48;&#41;>',
-        'javascript',
-        'HTML scheme clearing evasion -- UTF-8 decimal encoding.',
-        array('img'),
-      ),
-      array(
-        '<img src=&#00000106&#0000097&#00000118&#0000097&#00000115&#0000099&#00000114&#00000105&#00000112&#00000116&#0000058&#0000097&#00000108&#00000101&#00000114&#00000116&#0000040&#0000048&#0000041>',
-        'javascript',
-        'HTML scheme clearing evasion -- long UTF-8 encoding.',
-        array('img'),
-      ),
-      array(
-        '<img src=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x30&#x29>',
-        'javascript',
-        'HTML scheme clearing evasion -- UTF-8 hex encoding.',
-        array('img'),
-      ),
-      array(
-        "<img src=\"jav\tascript:alert(0)\">",
-        'script',
-        'HTML scheme clearing evasion -- an embedded tab.',
-        array('img'),
-      ),
-      array(
-        '<img src="jav&#x09;ascript:alert(0)">',
-        'script',
-        'HTML scheme clearing evasion -- an encoded, embedded tab.',
-        array('img'),
-      ),
-      array(
-        '<img src="jav&#x000000A;ascript:alert(0)">',
-        'script',
-        'HTML scheme clearing evasion -- an encoded, embedded newline.',
-        array('img'),
-      ),
-      // With &#xD; this test would fail, but the entity gets turned into
-      // &amp;#xD;, so it's OK.
-      array(
-        '<img src="jav&#x0D;ascript:alert(0)">',
-        'script',
-        'HTML scheme clearing evasion -- an encoded, embedded carriage return.',
-        array('img'),
-      ),
-      array(
-        "<img src=\"\n\n\nj\na\nva\ns\ncript:alert(0)\">",
-        'cript',
-        'HTML scheme clearing evasion -- broken into many lines.',
-        array('img'),
-      ),
-      array(
-        "<img src=\"jav\0a\0\0cript:alert(0)\">",
-        'cript',
-        'HTML scheme clearing evasion -- embedded nulls.',
-        array('img'),
-      ),
-      array(
-        '<img src="vbscript:msgbox(0)">',
-        'vbscript',
-        'HTML scheme clearing evasion -- another scheme.',
-        array('img'),
-      ),
-      array(
-        '<img src="nosuchscheme:notice(0)">',
-        'nosuchscheme',
-        'HTML scheme clearing evasion -- unknown scheme.',
-        array('img'),
-      ),
-      // Netscape 4.x javascript entities.
-      array(
-        '<br size="&{alert(0)}">',
-        'alert',
-        'Netscape 4.x javascript entities.',
-        array('br'),
-      ),
-      // DRUPAL-SA-2008-006: Invalid UTF-8, these only work as reflected XSS with
-      // Internet Explorer 6.
-      array(
-        "<p arg=\"\xe0\">\" style=\"background-image: url(javascript:alert(0));\"\xe0<p>",
-        'style',
-        'HTML filter -- invalid UTF-8.',
-        array('p'),
-      ),
-    );
-    // @fixme This dataset currently fails under 5.4 because of
-    //   https://drupal.org/node/1210798 . Restore after its fixed.
-    if (version_compare(PHP_VERSION, '5.4.0', '<')) {
-      $cases[] = array(
-        '<img src=" &#14;  javascript:alert(0)">',
-        'javascript',
-        'HTML scheme clearing evasion -- spaces and metacharacters before scheme.',
-        array('img'),
-      );
-    }
-    return $cases;
-  }
-
-  /**
-   * Checks that invalid multi-byte sequences are rejected.
-   *
-   * @param string $value
-   *   The value to filter.
-   * @param string $expected
-   *   The expected result.
-   * @param string $message
-   *   The assertion message to display upon failure.
-   *
-   * @dataProvider providerTestInvalidMultiByte
-   */
-  public function testInvalidMultiByte($value, $expected, $message) {
-    $this->assertEquals(Xss::filter($value), $expected, $message);
-  }
-
-  /**
-   * Data provider for testInvalidMultiByte().
-   *
-   * @see testInvalidMultiByte()
-   *
-   * @return array
-   *   An array of arrays containing strings:
-   *     - The value to filter.
-   *     - The value to expect after filtering.
-   *     - The assertion message.
-   */
-  public function providerTestInvalidMultiByte() {
-    return array(
-      array("Foo\xC0barbaz", '', 'Xss::filter() accepted invalid sequence "Foo\xC0barbaz"'),
-      array("Fooÿñ", "Fooÿñ", 'Xss::filter() rejects valid sequence Fooÿñ"'),
-      array("\xc0aaa", '', 'HTML filter -- overlong UTF-8 sequences.'),
-    );
-  }
-
-  /**
-   * Checks that strings starting with a question sign are correctly processed.
-   */
-  public function testQuestionSign() {
-    $value = Xss::filter('<?xml:namespace ns="urn:schemas-microsoft-com:time">');
-    $this->assertTrue(stripos($value, '<?xml') === FALSE, 'HTML tag stripping evasion -- starting with a question sign (processing instructions).');
-  }
-
-  /**
-   * Checks that Xss::filterAdmin() correctly strips unallowed tags.
-   */
-  public function testFilterXSSAdmin() {
-    $value = Xss::filterAdmin('<style /><iframe /><frame /><frameset /><meta /><link /><embed /><applet /><param /><layer />');
-    $this->assertEquals($value, '', 'Admin HTML filter -- should never allow some tags.');
-  }
-
-  /**
-   * Tests the loose, admin HTML filter.
-   *
-   * @param string $value
-   *   The value to filter.
-   * @param string $expected
-   *   The expected result.
-   * @param string $message
-   *   The assertion message to display upon failure.
-   *
-   * @dataProvider providerTestFilterXssAdminNotNormalized
-   */
-  public function testFilterXssAdminNotNormalized($value, $expected, $message) {
-    $this->assertNotNormalized(Xss::filterAdmin($value), $expected, $message);
-  }
-
-  /**
-   * Data provider for testFilterXssAdminNotNormalized().
-   *
-   * @see testFilterXssAdminNotNormalized()
-   *
-   * @return array
-   *   An array of arrays containing strings:
-   *     - The value to filter.
-   *     - The value to expect after filtering.
-   *     - The assertion message.
-   */
-  public function providerTestFilterXssAdminNotNormalized() {
-    return array(
-      // DRUPAL-SA-2008-044
-      array('<object />', 'object', 'Admin HTML filter -- should not allow object tag.'),
-      array('<script />', 'script', 'Admin HTML filter -- should not allow script tag.'),
-    );
-  }
-
-  /**
-   * Asserts that a text transformed to lowercase with HTML entities decoded does contains a given string.
-   *
-   * Otherwise fails the test with a given message, similar to all the
-   * SimpleTest assert* functions.
-   *
-   * Note that this does not remove nulls, new lines and other characters that
-   * could be used to obscure a tag or an attribute name.
-   *
-   * @param string $haystack
-   *   Text to look in.
-   * @param string $needle
-   *   Lowercase, plain text to look for.
-   * @param string $message
-   *   (optional) Message to display if failed. Defaults to an empty string.
-   * @param string $group
-   *   (optional) The group this message belongs to. Defaults to 'Other'.
-   */
-  protected function assertNormalized($haystack, $needle, $message = '', $group = 'Other') {
-    $this->assertTrue(strpos(strtolower(String::decodeEntities($haystack)), $needle) !== FALSE, $message, $group);
-  }
-
-  /**
-   * Asserts that text transformed to lowercase with HTML entities decoded does not contain a given string.
-   *
-   * Otherwise fails the test with a given message, similar to all the
-   * SimpleTest assert* functions.
-   *
-   * Note that this does not remove nulls, new lines, and other character that
-   * could be used to obscure a tag or an attribute name.
-   *
-   * @param string $haystack
-   *   Text to look in.
-   * @param string $needle
-   *   Lowercase, plain text to look for.
-   * @param string $message
-   *   (optional) Message to display if failed. Defaults to an empty string.
-   * @param string $group
-   *   (optional) The group this message belongs to. Defaults to 'Other'.
-   */
-  protected function assertNotNormalized($haystack, $needle, $message = '', $group = 'Other') {
-    $this->assertTrue(strpos(strtolower(String::decodeEntities($haystack)), $needle) === FALSE, $message, $group);
-  }
-
-}
diff --git a/core/tests/Drupal/Tests/Core/Common/AttributesTest.php b/core/tests/Drupal/Tests/Core/Common/AttributesTest.php
deleted file mode 100644
index 997c050..0000000
--- a/core/tests/Drupal/Tests/Core/Common/AttributesTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Tests\Core\Common\AttributesTest.
- */
-
-namespace Drupal\Tests\Core\Common;
-
-use Drupal\Core\Template\Attribute;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests the Drupal\Core\Template\Attribute functionality.
- */
-class AttributesTest extends UnitTestCase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'HTML Attributes',
-      'description' => 'Tests the Drupal\Core\Template\Attribute functionality.',
-      'group' => 'Common',
-    );
-  }
-
-  /**
-   * Provides data for the Attribute test.
-   *
-   * @return array
-   */
-  public function providerTestAttributeData() {
-    return array(
-      // Verify that special characters are HTML encoded.
-      array(array('title' => '&"\'<>'), ' title="&amp;&quot;&#039;&lt;&gt;"', 'HTML encode attribute values.'),
-      // Verify multi-value attributes are concatenated with spaces.
-      array(array('class' => array('first', 'last')), ' class="first last"', 'Concatenate multi-value attributes.'),
-      // Verify empty attribute values are rendered.
-      array(array('alt' => ''), ' alt=""', 'Empty attribute value #1.'),
-      array(array('alt' => NULL), ' alt=""', 'Empty attribute value #2.'),
-      // Verify multiple attributes are rendered.
-      array(
-        array(
-          'id' => 'id-test',
-          'class' => array('first', 'last'),
-          'alt' => 'Alternate',
-        ),
-        ' id="id-test" class="first last" alt="Alternate"',
-        'Multiple attributes.'
-      ),
-      // Verify empty attributes array is rendered.
-      array(array(), '', 'Empty attributes array.'),
-    );
-  }
-
-  /**
-   * Tests casting an Attribute object to a string.
-   *
-   * @see \Drupal\Core\Template\Attribute::__toString()
-   *
-   * @dataProvider providerTestAttributeData
-   */
-  function testDrupalAttributes($attributes, $expected, $message) {
-    $this->assertSame($expected, (string) new Attribute($attributes), $message);
-  }
-
-  /**
-   * Test attribute iteration
-   */
-  public function testAttributeIteration() {
-    $attribute = new Attribute(array('key1' => 'value1'));
-    foreach ($attribute as $value) {
-      $this->assertSame((string) $value, 'value1', 'Iterate over attribute.');
-    }
-  }
-
-}
diff --git a/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php b/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
deleted file mode 100644
index 105d716..0000000
--- a/core/tests/Drupal/Tests/Core/Common/UrlValidatorTest.php
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Tests\Core\Common\UrlValidatorTest.
- */
-
-namespace Drupal\Tests\Core\Common;
-
-use Drupal\Component\Utility\String;
-use Drupal\Component\Utility\UrlValidator;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests URL validation by valid_url().
- */
-class UrlValidatorTest extends UnitTestCase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'URL validation',
-      'description' => 'Tests URL validation by valid_url()',
-      'group' => 'Common',
-    );
-  }
-
-  /**
-   * Data provider for absolute URLs.
-   */
-  public function providerTestValidAbsoluteData() {
-    $urls = array(
-      'example.com',
-      'www.example.com',
-      'ex-ample.com',
-      '3xampl3.com',
-      'example.com/parenthesis',
-      'example.com/index.html#pagetop',
-      'example.com:8080',
-      'subdomain.example.com',
-      'example.com/index.php/node',
-      'example.com/index.php/node?param=false',
-      'user@www.example.com',
-      'user:pass@www.example.com:8080/login.php?do=login&style=%23#pagetop',
-      '127.0.0.1',
-      'example.org?',
-      'john%20doe:secret:foo@example.org/',
-      'example.org/~,$\'*;',
-      'caf%C3%A9.example.org',
-      '[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html',
-    );
-
-    return $this->dataEnhanceWithScheme($urls);
-  }
-
-  /**
-   * Tests valid absolute URLs.
-   *
-   * @param string $url
-   *   The url to test.
-   * @param string $scheme
-   *   The scheme to test.
-   *
-   * @dataProvider providerTestValidAbsoluteData
-   */
-  public function testValidAbsolute($url, $scheme) {
-    $test_url = $scheme . '://' . $url;
-    $valid_url = UrlValidator::isValid($test_url, TRUE);
-    $this->assertTrue($valid_url, String::format('@url is a valid URL.', array('@url' => $test_url)));
-  }
-
-  /**
-   * Provides invalid absolute URLs.
-   */
-  public function providerTestInvalidAbsolute() {
-    $data = array(
-      '',
-      'ex!ample.com',
-      'ex%ample.com',
-    );
-    return $this->dataEnhanceWithScheme($data);
-  }
-
-  /**
-   * Tests invalid absolute URLs.
-   *
-   * @param string $url
-   *   The url to test.
-   * @param string $scheme
-   *   The scheme to test.
-   *
-   * @dataProvider providerTestInvalidAbsolute
-   */
-  public function testInvalidAbsolute($url, $scheme) {
-    $test_url = $scheme . '://' . $url;
-    $valid_url = UrlValidator::isValid($test_url, TRUE);
-    $this->assertFalse($valid_url, String::format('@url is NOT a valid URL.', array('@url' => $test_url)));
-  }
-
-  /**
-   * Provides valid relative URLs
-   */
-  public function providerTestValidRelativeData() {
-    $data = array(
-      'paren(the)sis',
-      'index.html#pagetop',
-      'index.php/node',
-      'index.php/node?param=false',
-      'login.php?do=login&style=%23#pagetop',
-    );
-
-    return $this->dataEnhanceWithPrefix($data);
-  }
-
-  /**
-   * Tests valid relative URLs.
-   *
-   * @param string $url
-   *   The url to test.
-   * @param string $prefix
-   *   The prefix to test.
-   *
-   * @dataProvider providerTestValidRelativeData
-   */
-  public function testValidRelative($url, $prefix) {
-    $test_url = $prefix . $url;
-    $valid_url = Urlvalidator::isValid($test_url);
-    $this->assertTrue($valid_url, String::format('@url is a valid URL.', array('@url' => $test_url)));
-  }
-
-  /**
-   * Provides invalid relative URLs.
-   */
-  public function providerTestInvalidRelativeData() {
-    $data = array(
-      'ex^mple',
-      'example<>',
-      'ex%ample',
-    );
-    return $this->dataEnhanceWithPrefix($data);
-  }
-
-  /**
-   * Tests invalid relative URLs.
-   *
-   * @param string $url
-   *   The url to test.
-   * @param string $prefix
-   *   The prefix to test.
-   *
-   * @dataProvider providerTestInvalidRelativeData
-   */
-  public function testInvalidRelative($url, $prefix) {
-    $test_url = $prefix . $url;
-    $valid_url = UrlValidator::isValid($test_url);
-    $this->assertFalse($valid_url, String::format('@url is NOT a valid URL.', array('@url' => $test_url)));
-  }
-
-  /**
-   * Enhances test urls with schemes
-   *
-   * @param array $urls
-   *   The list of urls.
-   *
-   * @return array
-   *   A list of provider data with schemes.
-   */
-  protected function dataEnhanceWithScheme(array $urls) {
-    $url_schemes = array('http', 'https', 'ftp');
-    $data = array();
-    foreach ($url_schemes as $scheme) {
-      foreach ($urls as $url) {
-        $data[] = array($url, $scheme);
-      }
-    }
-    return $data;
-  }
-
-  /**
-   * Enhances test urls with prefixes.
-   *
-   * @param array $urls
-   *   The list of urls.
-   *
-   * @return array
-   *   A list of provider data with prefixes.
-   */
-  protected function dataEnhanceWithPrefix(array $urls) {
-    $prefixes = array('', '/');
-    $data = array();
-    foreach ($prefixes as $prefix) {
-      foreach ($urls as $url) {
-        $data[] = array($url, $prefix);
-      }
-    }
-    return $data;
-  }
-
-
-}
