Adding custom URL test for FormHelper::create()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5730 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-10-07 14:13:03 +00:00
parent 5f0ea6fd2e
commit c15b36905a

View file

@ -811,11 +811,16 @@ class FormHelperTest extends CakeTestCase {
$result = $this->Form->create('User', array('url' => array('action' => 'login')));
$this->assertPattern('/id="UserAddForm"/', $result);
$this->assertPattern('/action="\/users\/login[\/]"/', $result);
$this->assertPattern('/action="\/users\/login(\/)?"/', $result);
$result = $this->Form->create('User', array('action' => 'login'));
$this->assertPattern('/id="UserLoginForm"/', $result);
$this->assertPattern('/action="\/users\/login[\/]"/', $result);
$this->assertPattern('/action="\/users\/login(\/)?"/', $result);
$result = $this->Form->create('User', array('url' => '/users/login'));
$this->assertPattern('/method="post"/', $result);
$this->assertPattern('/action="\/users\/login(\/)?"/', $result);
$this->assertNoPattern('/^<form[^<>]+[^method|action]=[^<>]*>/', $result);
}
function testFormMagicInput() {