From abb287180d8c9084e5054d3979d76aff4ef55fcc Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Sat, 28 Apr 2007 07:42:54 +0000 Subject: [PATCH] Adding tests for #2371 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4891 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/helpers/form.test.php | 6 ++++++ cake/tests/cases/libs/view/helpers/html.test.php | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 6335ce1d8..583f8d9a7 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -585,6 +585,12 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->submit('Test Submit', array('div' => array('id' => 'SaveButton'))); $this->assertPattern('/^]+id="SaveButton"[^<>]*>]+value="Test Submit"[^<>]+\/><\/div>$/', $result); $this->assertNoPattern('/]+[^type|value]=[^<>]*>/', $result); + + $result = $this->Form->submit('Next >'); + $this->assertPattern('/^]+value="Next >"[^<>]+\/><\/div>$/', $result); + + $result = $this->Form->submit('Next >', array('escape'=>false)); + $this->assertPattern('/^]+value="Next >"[^<>]+\/><\/div>$/', $result); } function testFormCreate() { diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index fbf8e0413..5f0a0cbfe 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -47,6 +47,18 @@ class HtmlHelperTest extends UnitTestCase { ClassRegistry::addObject('view', $view); } + function testLinkEscape() { + $result = $this->Html->link('Next >', '#'); + $expected = '/^Next ><\/a>$/'; + + $this->assertPattern($expected, $result); + + $result = $this->Html->link('Next >', '#', array('escape' => false)); + $expected = '/^Next ><\/a>$/'; + + $this->assertPattern($expected, $result); + } + function testImageLink() { $result = $this->Html->link($this->Html->image('test.gif'), '#', array(), false, false, false); $expected = '/^<\/a>$/';