diff --git a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
index 7eb10ce..fca79ac 100644
--- a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php
@@ -37,4 +37,53 @@ public function testRandomBytes() {
     }
   }
 
+  /**
+   * Tests \Drupal\Component\Utility\Crypt::hashBase64().
+   *
+   * @dataProvider providerTestHashBase64
+   */
+  public function testHashBase64($data, $expectedHash) {
+    $hash = Crypt::hashBase64($data);
+    $this->assertEquals($expectedHash, $hash, 'The correct hash was not calculated.');
+  }
+
+  /**
+   * Tests \Drupal\Component\Utility\Crypt::hmacBase64().
+   *
+   * @dataProvider providerTestHmacBase64
+   */
+  public function testHmacBase64($data, $key, $expectedHmac) {
+    $hmac = Crypt::hmacBase64($data, $key);
+    $this->assertEquals($expectedHmac, $hmac, 'The correct hmac was not calculated.');
+  }
+
+  /**
+   * Provides data for self::testHashBase64().
+   */
+  public static function providerTestHashBase64() {
+    return array(
+      array(
+        'data' => 'The SHA (Secure Hash Algorithm) is one of a number of cryptographic hash functions. A cryptographic hash is like a signature for a text or a data file. SHA-256 algorithm generates an almost-unique, fixed size 256-bit (32-byte) hash. Hash is a one way function – it cannot be decrypted back. This makes it suitable for password validation, challenge hash authentication, anti-tamper, digital signatures.',
+        'expectedHash' => '034rT6smZAVRxpq8O98cFFNLIVx_Ph1EwLZQKcmRR_s',
+      ),
+      array(
+        'data' => 'SHA-256 is one of the successor hash functions to SHA-1, and is one of the strongest hash functions available.',
+        'expectedHash' => 'yuqkDDYqprL71k4xIb6K6D7n76xldO4jseRhEkEE6SI',
+      ),
+    );
+  }
+
+  /**
+   * Provides data for self::testHmacBase64().
+   */
+  public static function providerTestHmacBase64() {
+    return array(
+      array(
+        'data' => 'Calculates a base-64 encoded, URL-safe sha-256 hmac.',
+        'key' => 'secret-key',
+        'expectedHmac' => '2AaH63zwjhekWZlEpAiufyfhAHIzbQhl9Hd9oCi3_c8',
+      ),
+    );
+  }
+
 }
diff --git a/core/tests/Drupal/Tests/Component/Utility/UrlTest.php b/core/tests/Drupal/Tests/Component/Utility/UrlTest.php
index 769a10d..de62324 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UrlTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UrlTest.php
@@ -38,6 +38,7 @@ public function providerTestBuildQuery() {
       array(array(' &#//+%20@۞' => 'a'), '%20%26%23%2F%2F%2B%2520%40%DB%9E=a', 'Key was properly encoded.'),
       array(array('a' => '1', 'b' => '2', 'c' => '3'), 'a=1&b=2&c=3', 'Multiple values were properly concatenated.'),
       array(array('a' => array('b' => '2', 'c' => '3'), 'd' => 'foo'), 'a[b]=2&a[c]=3&d=foo', 'Nested array was properly encoded.'),
+      array(array('foo' => NULL), 'foo', 'Simple parameters are properly added.'),
     );
   }
 
@@ -189,6 +190,185 @@ public function testInvalidRelative($url, $prefix) {
   }
 
   /**
+   * Tests query filtering.
+   *
+   * @dataProvider providerTestFilterQueryParameters
+   *
+   * @see \Drupal\Component\Utility\Url::filterQueryParameters().
+   */
+  public function testFilterQueryParameters($query, $exclude, $expected) {
+    $filtered = Url::filterQueryParameters($query, $exclude);
+    $this->assertEquals($expected, $filtered, 'The query was not properly filtered.');
+  }
+
+  /**
+   * Provides data to self::testFilterQueryParameters().
+   */
+  public static function providerTestFilterQueryParameters() {
+    return array(
+      // Test without an exclude filter.
+      array(
+        'query' => array('a' => array('b' => 'c')),
+        'exclude' => array(),
+        'expected' => array('a' => array('b' => 'c')),
+      ),
+      // Exclude the 'b' element.
+      array(
+        'query' => array('a' => array('b' => 'c', 'd' => 'e')),
+        'exclude' => array('a[b]'),
+        'expected' => array('a' => array('d' => 'e')),
+      ),
+    );
+  }
+
+  /**
+   * Tests url parsing.
+   *
+   * @dataProvider providerTestParse
+   *
+   * @see \Drupal\Component\Utility\Url::parse()
+   */
+  public function testParse($url, $expected) {
+    $parsed = Url::parse($url);
+    $this->assertEquals($expected, $parsed, 'The url was not properly parsed.');
+  }
+
+  /**
+   * Provides data for self::testParse().
+   */
+  public static function providerTestParse() {
+    return array(
+      array(
+        'http://www.example.com/my/path',
+        array(
+          'path' => 'http://www.example.com/my/path',
+          'query' => array(),
+          'fragment' => '',
+        ),
+      ),
+      array(
+        'http://www.example.com/my/path?destination=home#footer',
+        array(
+          'path' => 'http://www.example.com/my/path',
+          'query' => array(
+            'destination' => 'home',
+          ),
+          'fragment' => 'footer',
+        ),
+      ),
+      array(
+        '/my/path?destination=home#footer',
+        array(
+          'path' => '/my/path',
+          'query' => array(
+            'destination' => 'home',
+          ),
+          'fragment' => 'footer',
+        ),
+      ),
+    );
+  }
+
+  /**
+   * Tests path encoding.
+   *
+   * @see \Drupal\Component\Utility\Url::encodePath().
+   *
+   * @dataProvider providerTestEncodePath
+   */
+  public function testEncodePath($path, $expected) {
+    $encoded = Url::encodePath($path);
+    $this->assertEquals($expected, $encoded);
+  }
+
+  /**
+   * Provides data for self::testEncodePath().
+   */
+  public static function providerTestEncodePath() {
+    return array(
+      array('unencoded path with spaces', 'unencoded%20path%20with%20spaces'),
+      array('slashes/should/be/preserved', 'slashes/should/be/preserved'),
+    );
+  }
+
+  /**
+   * Tests external versus internal paths.
+   *
+   * @see \Drupal\Component\Utility\Url::isExternal()
+   *
+   * @dataProvider providerTestIsExternal
+   */
+  public function testIsExternal($path, $expected) {
+    $isExternal = Url::isExternal($path);
+    $this->assertEquals($expected, $isExternal);
+  }
+
+  /**
+   * Provides data for self::testIsExternal().
+   */
+  public static function providerTestIsExternal() {
+    return array(
+      array('/internal/path', FALSE),
+      array('https://example.com/external/path', TRUE),
+      array('javascript://fake-external-path', FALSE),
+    );
+  }
+
+  /**
+   * Tests bad protocol filtering and escaping.
+   *
+   * @dataProvider providerTestFilterBadProtocol
+   */
+  public function testFilterBadProtocol($uri, $expected, $protocols) {
+    Url::setAllowedProtocols($protocols);
+    $filtered = Url::filterBadProtocol($uri);
+    $this->assertEquals($expected, $filtered);
+  }
+
+  /**
+   * Provides data for self::testTestFilterBadProtocol().
+   */
+  public static function providerTestFilterBadProtocol() {
+    return array(
+      array('javascript://example.com?foo&bar', '//example.com?foo&amp;bar', array('http', 'https')),
+      // Test custom protocols.
+      array('http://example.com?foo&bar', '//example.com?foo&amp;bar', array('https')),
+      // Valid protocol.
+      array('http://example.com?foo&bar', 'http://example.com?foo&amp;bar', array('https', 'http')),
+      // Colon not part of the URL scheme.
+      array('/test:8888?foo&bar', '/test:8888?foo&amp;bar', array('http')),
+    );
+  }
+
+  /**
+   * Tests dangerous url protocol filtering.
+   *
+   * @dataProvider providerTestStripDangerousProtocols
+   *
+   * @see \Drupal\Component\Utility\Url::stripDangerousProtocols()
+   */
+  public function testStripDangerousProtocols($uri, $expected, $protocols) {
+    Url::setAllowedProtocols($protocols);
+    $stripped = Url::stripDangerousProtocols($uri);
+    $this->assertEquals($expected, $stripped);
+  }
+
+  /**
+   * Provides data for self::testStripDangerousProtocols().
+   */
+  public static function providerTestStripDangerousProtocols() {
+    return array(
+      array('javascript://example.com', '//example.com', array('http', 'https')),
+      // Test custom protocols.
+      array('http://example.com', '//example.com', array('https')),
+      // Valid protocol.
+      array('http://example.com', 'http://example.com', array('https', 'http')),
+      // Colon not part of the URL scheme.
+      array('/test:8888', '/test:8888', array('http')),
+    );
+  }
+
+  /**
    * Enhances test urls with schemes
    *
    * @param array $urls
