From 2a674fc461b0d2a80a9af6948129dcf41d2644e4 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 1 Aug 2012 12:14:46 +0200 Subject: [PATCH] adding a test for the yet untested javascript protocol --- lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php index 887b25b0cce..bbf5a65d5a3 100644 --- a/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php @@ -338,6 +338,10 @@ public function testLink() { $expected = array('a' => array('href' => 'http://www.example.org?param1=value1&param2=value2'), 'http://www.example.org?param1=value1&param2=value2', '/a'); $this->assertTags($result, $expected); + $result = $this->Html->link('alert', 'javascript:alert(\'cakephp\');'); + $expected = array('a' => array('href' => 'javascript:alert('cakephp');'), 'alert', '/a'); + $this->assertTags($result, $expected); + $result = $this->Html->link('write me', 'mailto:example@cakephp.org'); $expected = array('a' => array('href' => 'mailto:example@cakephp.org'), 'write me', '/a'); $this->assertTags($result, $expected);