Skip to content

Commit

Permalink
Remove BC mapping of "ext" to "_ext".
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 1, 2014
1 parent 0a566bd commit 1ea269a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,6 @@ public static function url($url = null, $options = []) {
$frag = '#' . $url['#'];
unset($url['#']);
}
if (isset($url['ext'])) {
$url['_ext'] = $url['ext'];
unset($url['ext']);
}
if (isset($url['ssl'])) {
$url['_scheme'] = ($url['ssl'] == true) ? 'https' : 'http';
unset($url['ssl']);
Expand Down Expand Up @@ -1079,7 +1075,7 @@ public static function parseNamedParams(Request $request, $options = []) {
* specific kinds of scopes.
*
* Routing scopes will inherit the globally set extensions configured with
* Router::parseExtensions(). You can also set valid extensions using
* Router::parseExtensions(). You can also set valid extensions using
* `$routes->extensions()` in your closure.
*
* @param string $path The path prefix for the scope. This path will be prepended
Expand Down
10 changes: 5 additions & 5 deletions tests/TestCase/View/Helper/HtmlHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function testImageTag() {
$result = $this->Html->image('//google.com/logo.gif');
$this->assertTags($result, array('img' => array('src' => '//google.com/logo.gif', 'alt' => '')));

$result = $this->Html->image(array('controller' => 'test', 'action' => 'view', 1, 'ext' => 'gif'));
$result = $this->Html->image(array('controller' => 'test', 'action' => 'view', 1, '_ext' => 'gif'));
$this->assertTags($result, array('img' => array('src' => '/test/view/1.gif', 'alt' => '')));

$result = $this->Html->image('/test/view/1.gif');
Expand Down Expand Up @@ -1509,13 +1509,13 @@ public function testNestedList() {
public function testMeta() {
Router::connect('/:controller', array('action' => 'index'));

$result = $this->Html->meta('this is an rss feed', array('controller' => 'posts', 'ext' => 'rss'));
$result = $this->Html->meta('this is an rss feed', array('controller' => 'posts', '_ext' => 'rss'));
$this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.rss/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'this is an rss feed')));

$result = $this->Html->meta('rss', array('controller' => 'posts', 'ext' => 'rss'), array('title' => 'this is an rss feed'));
$result = $this->Html->meta('rss', array('controller' => 'posts', '_ext' => 'rss'), array('title' => 'this is an rss feed'));
$this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.rss/', 'type' => 'application/rss+xml', 'rel' => 'alternate', 'title' => 'this is an rss feed')));

$result = $this->Html->meta('atom', array('controller' => 'posts', 'ext' => 'xml'));
$result = $this->Html->meta('atom', array('controller' => 'posts', '_ext' => 'xml'));
$this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xml/', 'type' => 'application/atom+xml', 'title' => 'atom')));

$result = $this->Html->meta('non-existing');
Expand All @@ -1527,7 +1527,7 @@ public function testMeta() {
$result = $this->Html->meta('non-existing', '/posts.xpp', array('type' => 'atom'));
$this->assertTags($result, array('link' => array('href' => 'preg:/.*\/posts\.xpp/', 'type' => 'application/atom+xml', 'title' => 'non-existing')));

$result = $this->Html->meta('atom', array('controller' => 'posts', 'ext' => 'xml'), array('link' => '/articles.rss'));
$result = $this->Html->meta('atom', array('controller' => 'posts', '_ext' => 'xml'), array('link' => '/articles.rss'));
$this->assertTags($result, array('link' => array('href' => 'preg:/.*\/articles\.rss/', 'type' => 'application/atom+xml', 'title' => 'atom')));

$result = $this->Html->meta('keywords', 'these, are, some, meta, keywords');
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public function testAssetUrl() {
$result = $this->Helper->assetUrl(array(
'controller' => 'js',
'action' => 'post',
'ext' => 'js'
'_ext' => 'js'
),
array('fullBase' => true)
);
Expand Down

0 comments on commit 1ea269a

Please sign in to comment.