mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test I forgot to commit with [5677]
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5678 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
dc76d14191
commit
6677e0abcc
1 changed files with 26 additions and 0 deletions
|
@ -1635,6 +1635,32 @@ class ModelTest extends CakeTestCase {
|
|||
$result = $this->model->validates();
|
||||
$this->assertFalse($result);
|
||||
|
||||
$this->model->validate['modified'] = array('allowEmpty' => false, 'rule' => 'date');
|
||||
|
||||
$data = array('TestValidate' => array('modified' => null));
|
||||
$result = $this->model->create($data);
|
||||
$this->assertTrue($result);
|
||||
$result = $this->model->validates();
|
||||
$this->assertFalse($result);
|
||||
|
||||
$data = array('TestValidate' => array('modified' => false));
|
||||
$result = $this->model->create($data);
|
||||
$this->assertTrue($result);
|
||||
$result = $this->model->validates();
|
||||
$this->assertFalse($result);
|
||||
|
||||
$data = array('TestValidate' => array('modified' => ''));
|
||||
$result = $this->model->create($data);
|
||||
$this->assertTrue($result);
|
||||
$result = $this->model->validates();
|
||||
$this->assertFalse($result);
|
||||
|
||||
$data = array('TestValidate' => array('modified' => '2007-05-01'));
|
||||
$result = $this->model->create($data);
|
||||
$this->assertTrue($result);
|
||||
$result = $this->model->validates();
|
||||
$this->assertTrue($result);
|
||||
|
||||
$this->model->validate['slug'] = array('allowEmpty' => false, 'rule' => array('maxLength', 45));
|
||||
|
||||
$data = array('TestValidate' => array('user_id' => '1', 'title' => 0, 'body' => 'body', 'slug' => ''));
|
||||
|
|
Loading…
Reference in a new issue