Skip to content
Permalink
Browse files

Rename option "ssl" to "_ssl" for consitency with other options.

  • Loading branch information...
ADmad committed Jul 1, 2014
1 parent 1ea269a commit 56022b6459300d414238ee2e18a44adab036d7cd
Showing with 9 additions and 19 deletions.
  1. +4 −4 src/Routing/Router.php
  2. +5 −15 tests/TestCase/Routing/RouterTest.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.
@@ -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);

0 comments on commit 56022b6

Please sign in to comment.
You can’t perform that action at this time.