# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\Users\Thomas\Documents\NetBeansProjects\wordpress-develop
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: tests/phpunit/tests/canonical/forceSsl.php
--- tests/phpunit/tests/canonical/forceSsl.php No Base Revision
+++ tests/phpunit/tests/canonical/forceSsl.php Locally New
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @group canonical
+ * @group rewrite
+ * @group query
+ */
+class Tests_Canonical_Force_SSL extends WP_Canonical_UnitTestCase {
+
+    function setUp() {
+        parent::setUp();
+        define('FORCE_SSL', true);
+
+        $this->http  = home_url('sample-page/', 'http');
+        $this->https = home_url('sample-page/', 'https');
+    }
+
+    public function set_https($url) {
+        return set_url_scheme($url, 'https');
+    }
+
+    /**
+     * @ticket 27954
+     */
+    public function test_http_request_with_http_home() {
+        $redirect = redirect_canonical($this->http, FALSE);
+        $this->assertEquals($redirect, $this->https);
+    }
+
+    /**
+     * @ticket 27954
+     */
+    public function test_https_request_with_http_home() {
+        $redirect = redirect_canonical($this->http, FALSE);
+        $this->assertEquals($redirect, FALSE); // No redirect
+    }
+
+    /**
+     * @ticket 27954
+     */
+    public function test_http_request_with_https_home() {
+        add_filter('home_url', array($this, 'set_https'));
+        $redirect = redirect_canonical($this->http, FALSE);
+        $this->assertEquals($redirect, $this->https);
+        remove_filter('home_url', array($this, 'set_https'));
+    }
+
+    /**
+     * @ticket 27954
+     */
+    public function test_https_request_with_https_home() {
+        add_filter('home_url', array($this, 'set_https'));
+        $redirect = redirect_canonical($this->http, FALSE);
+        $this->assertEquals($redirect, FALSE); // No redirect
+        remove_filter('home_url', array($this, 'set_https'));
+    }
+
+}
