Skip to content

Commit

Permalink
Add viewport to built-in options for HtmlHelper::meta()
Browse files Browse the repository at this point in the history
Refs #3553
  • Loading branch information
markstory committed May 23, 2014
1 parent 57b8876 commit 51b3d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/View/Helper/HtmlHelper.php
Expand Up @@ -214,6 +214,7 @@ public function meta($type, $content = null, array $options = array()) {
'keywords' => array('name' => 'keywords', 'content' => $content),
'description' => array('name' => 'description', 'content' => $content),
'robots' => array('name' => 'robots', 'content' => $content),
'viewport' => array('name' => 'viewport', 'content' => $content),
);

if ($type === 'icon' && $content === null) {
Expand Down
8 changes: 6 additions & 2 deletions tests/TestCase/View/Helper/HtmlHelperTest.php
@@ -1,7 +1,5 @@
<?php
/**
* HtmlHelperTest file
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -1514,6 +1512,12 @@ public function testMeta() {

$result = $this->Html->meta('robots', 'ALL');
$this->assertTags($result, array('meta' => array('name' => 'robots', 'content' => 'ALL')));

$result = $this->Html->meta('viewport', 'width=device-width');
$expected = [
'meta' => ['name' => 'viewport', 'content' => 'width=device-width']
];
$this->assertTags($result, $expected);
}

/**
Expand Down

0 comments on commit 51b3d46

Please sign in to comment.