mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding tests for #2371
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4891 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
9b8f81cc82
commit
abb287180d
2 changed files with 18 additions and 0 deletions
|
@ -585,6 +585,12 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$result = $this->Form->submit('Test Submit', array('div' => array('id' => 'SaveButton')));
|
$result = $this->Form->submit('Test Submit', array('div' => array('id' => 'SaveButton')));
|
||||||
$this->assertPattern('/^<div[^<>]+id="SaveButton"[^<>]*><input type="submit"[^<>]+value="Test Submit"[^<>]+\/><\/div>$/', $result);
|
$this->assertPattern('/^<div[^<>]+id="SaveButton"[^<>]*><input type="submit"[^<>]+value="Test Submit"[^<>]+\/><\/div>$/', $result);
|
||||||
$this->assertNoPattern('/<input[^<>]+[^type|value]=[^<>]*>/', $result);
|
$this->assertNoPattern('/<input[^<>]+[^type|value]=[^<>]*>/', $result);
|
||||||
|
|
||||||
|
$result = $this->Form->submit('Next >');
|
||||||
|
$this->assertPattern('/^<div\s+class="submit"><input type="submit"[^<>]+value="Next >"[^<>]+\/><\/div>$/', $result);
|
||||||
|
|
||||||
|
$result = $this->Form->submit('Next >', array('escape'=>false));
|
||||||
|
$this->assertPattern('/^<div\s+class="submit"><input type="submit"[^<>]+value="Next >"[^<>]+\/><\/div>$/', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFormCreate() {
|
function testFormCreate() {
|
||||||
|
|
|
@ -47,6 +47,18 @@ class HtmlHelperTest extends UnitTestCase {
|
||||||
ClassRegistry::addObject('view', $view);
|
ClassRegistry::addObject('view', $view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testLinkEscape() {
|
||||||
|
$result = $this->Html->link('Next >', '#');
|
||||||
|
$expected = '/^<a href="#"\s+>Next ><\/a>$/';
|
||||||
|
|
||||||
|
$this->assertPattern($expected, $result);
|
||||||
|
|
||||||
|
$result = $this->Html->link('Next >', '#', array('escape' => false));
|
||||||
|
$expected = '/^<a href="#"\s+>Next ><\/a>$/';
|
||||||
|
|
||||||
|
$this->assertPattern($expected, $result);
|
||||||
|
}
|
||||||
|
|
||||||
function testImageLink() {
|
function testImageLink() {
|
||||||
$result = $this->Html->link($this->Html->image('test.gif'), '#', array(), false, false, false);
|
$result = $this->Html->link($this->Html->image('test.gif'), '#', array(), false, false, false);
|
||||||
$expected = '/^<a href="#"\s+><img\s+src="img\/test.gif"\s+alt=""\s+\/><\/a>$/';
|
$expected = '/^<a href="#"\s+><img\s+src="img\/test.gif"\s+alt=""\s+\/><\/a>$/';
|
||||||
|
|
Loading…
Reference in a new issue