mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing FormHelperTest for phpunit
This commit is contained in:
parent
32a46e9eda
commit
f7949d6ace
1 changed files with 12 additions and 9 deletions
|
@ -1306,7 +1306,8 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'OpenidUrl' => array('url' => 'http://www.cakephp.org')
|
'OpenidUrl' => array('url' => 'http://www.cakephp.org')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertTrue($this->UserForm->OpenidUrl->create($data));
|
$result = $this->UserForm->OpenidUrl->create($data);
|
||||||
|
$this->assertFalse(empty($result));
|
||||||
$this->assertFalse($this->UserForm->OpenidUrl->validates());
|
$this->assertFalse($this->UserForm->OpenidUrl->validates());
|
||||||
|
|
||||||
$result = $this->Form->create('UserForm', array('type' => 'post', 'action' => 'login'));
|
$result = $this->Form->create('UserForm', array('type' => 'post', 'action' => 'login'));
|
||||||
|
@ -1322,7 +1323,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$expected = array('OpenidUrl' => array('openid_not_registered' => 1));
|
$expected = array('OpenidUrl' => array('openid_not_registered' => true));
|
||||||
$this->assertEqual($this->Form->validationErrors, $expected);
|
$this->assertEqual($this->Form->validationErrors, $expected);
|
||||||
|
|
||||||
$result = $this->Form->error(
|
$result = $this->Form->error(
|
||||||
|
@ -1350,7 +1351,8 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'ValidateProfile' => array('full_name' => 'Mariano Iglesias')
|
'ValidateProfile' => array('full_name' => 'Mariano Iglesias')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertTrue($this->ValidateUser->create($data));
|
$result = $this->ValidateUser->create($data);
|
||||||
|
$this->assertFalse(empty($result));
|
||||||
$this->assertFalse($this->ValidateUser->validates());
|
$this->assertFalse($this->ValidateUser->validates());
|
||||||
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
|
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
|
||||||
|
|
||||||
|
@ -1365,8 +1367,8 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'ValidateUser' => array('email' => 1),
|
'ValidateUser' => array('email' => true),
|
||||||
'ValidateProfile' => array('full_name' => 1, 'city' => 1)
|
'ValidateProfile' => array('full_name' => true, 'city' => true)
|
||||||
);
|
);
|
||||||
$this->assertEqual($this->Form->validationErrors, $expected);
|
$this->assertEqual($this->Form->validationErrors, $expected);
|
||||||
|
|
||||||
|
@ -1393,7 +1395,8 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'ValidateItem' => array('name' => 'Item')
|
'ValidateItem' => array('name' => 'Item')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertTrue($this->ValidateUser->create($data));
|
$result = $this->ValidateUser->create($data);
|
||||||
|
$this->assertFalse(empty($result));
|
||||||
$this->assertFalse($this->ValidateUser->validates());
|
$this->assertFalse($this->ValidateUser->validates());
|
||||||
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
|
$this->assertFalse($this->ValidateUser->ValidateProfile->validates());
|
||||||
$this->assertFalse($this->ValidateUser->ValidateProfile->ValidateItem->validates());
|
$this->assertFalse($this->ValidateUser->ValidateProfile->ValidateItem->validates());
|
||||||
|
@ -1409,9 +1412,9 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'ValidateUser' => array('email' => 1),
|
'ValidateUser' => array('email' => true),
|
||||||
'ValidateProfile' => array('full_name' => 1, 'city' => 1),
|
'ValidateProfile' => array('full_name' => true, 'city' => true),
|
||||||
'ValidateItem' => array('description' => 1)
|
'ValidateItem' => array('description' => true)
|
||||||
);
|
);
|
||||||
$this->assertEqual($this->Form->validationErrors, $expected);
|
$this->assertEqual($this->Form->validationErrors, $expected);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue