From 56022b6459300d414238ee2e18a44adab036d7cd Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 1 Jul 2014 18:19:21 +0530 Subject: [PATCH] Rename option "ssl" to "_ssl" for consitency with other options. --- src/Routing/Router.php | 8 ++++---- tests/TestCase/Routing/RouterTest.php | 20 +++++--------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/Routing/Router.php b/src/Routing/Router.php index 623008955ff..0e9265b43fc 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -680,7 +680,7 @@ protected static function _applyUrlFilters($url) { * - `_port` - Set the port if you need to create links on non-standard ports. * - `_full` - If true output of `Router::fullBaseUrl()` will be prepended to generated URLs. * - `#` - Allows you to set URL hash fragments. - * - `ssl` - Set to true to convert the generated URL to https, or false to force http. + * - `_ssl` - Set to true to convert the generated URL to https, or false to force http. * * @param string|array $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" * or an array specifying any of the following: 'controller', 'action', 'plugin' @@ -757,9 +757,9 @@ public static function url($url = null, $options = []) { $frag = '#' . $url['#']; unset($url['#']); } - if (isset($url['ssl'])) { - $url['_scheme'] = ($url['ssl'] == true) ? 'https' : 'http'; - unset($url['ssl']); + if (isset($url['_ssl'])) { + $url['_scheme'] = ($url['_ssl'] === true) ? 'https' : 'http'; + unset($url['_ssl']); } // Copy the current action if the controller is the current one. diff --git a/tests/TestCase/Routing/RouterTest.php b/tests/TestCase/Routing/RouterTest.php index 2d2de4a9ec8..7820547b8ba 100644 --- a/tests/TestCase/Routing/RouterTest.php +++ b/tests/TestCase/Routing/RouterTest.php @@ -1045,15 +1045,6 @@ public function testUrlGenerationWithExtensions() { )); $expected = '/articles.json'; $this->assertEquals($expected, $result); - - $result = Router::url(array( - 'plugin' => null, - 'controller' => 'articles', - 'action' => 'index', - 'ext' => 'json' - )); - $expected = '/articles.json'; - $this->assertEquals($expected, $result); } /** @@ -1819,12 +1810,12 @@ public function testGenerationWithSslOption() { ); $result = Router::url(array( - 'ssl' => true + '_ssl' => true )); $this->assertEquals('https://localhost/images/index', $result); $result = Router::url(array( - 'ssl' => false + '_ssl' => false )); $this->assertEquals('http://localhost/images/index', $result); } @@ -1853,12 +1844,12 @@ public function testGenerateWithSslInSsl() { ); $result = Router::url(array( - 'ssl' => false + '_ssl' => false )); $this->assertEquals('http://localhost/images/index', $result); $result = Router::url(array( - 'ssl' => true + '_ssl' => true )); $this->assertEquals('https://localhost/images/index', $result); } @@ -2087,7 +2078,6 @@ public function testParsingWithPatternOnAction() { $result = Router::parse('/blog/foobar'); $this->assertSame([], $result); - } /** @@ -2503,7 +2493,7 @@ public function testReverseWithExtension() { 'controller' => 'posts', 'action' => 'view', 'pass' => array(1), - 'ext' => 'json', + '_ext' => 'json', )); $request->query = []; $result = Router::reverse($request);