diff --git a/src/View/Helper/HtmlHelper.php b/src/View/Helper/HtmlHelper.php index 7930963610d..c1484b6e078 100644 --- a/src/View/Helper/HtmlHelper.php +++ b/src/View/Helper/HtmlHelper.php @@ -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) { diff --git a/tests/TestCase/View/Helper/HtmlHelperTest.php b/tests/TestCase/View/Helper/HtmlHelperTest.php index 77f2c0ff7cd..ce3b328e44c 100644 --- a/tests/TestCase/View/Helper/HtmlHelperTest.php +++ b/tests/TestCase/View/Helper/HtmlHelperTest.php @@ -1,7 +1,5 @@ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @@ -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); } /**