Skip to content
Permalink
Browse files

Remove BC mapping of "ext" to "_ext".

  • Loading branch information...
ADmad committed Jul 1, 2014
1 parent 0a566bd commit 1ea269a1e2d0a8b38fd3b3e55d27792254e27e8c
Showing with 7 additions and 11 deletions.
  1. +1 −5 src/Routing/Router.php
  2. +5 −5 tests/TestCase/View/Helper/HtmlHelperTest.php
  3. +1 −1 tests/TestCase/View/HelperTest.php
@@ -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']);
@@ -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
@@ -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');
@@ -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');
@@ -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');
@@ -304,7 +304,7 @@ public function testAssetUrl() {
$result = $this->Helper->assetUrl(array(
'controller' => 'js',
'action' => 'post',
'ext' => 'js'
'_ext' => 'js'
),
array('fullBase' => true)
);

0 comments on commit 1ea269a

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