mirror of
https://github.com/yiisoft/yii.git
synced 2026-02-20 01:21:22 +01:00
Add tests for allowEmpty as true
This commit is contained in:
@@ -14,7 +14,8 @@ class CCaptchaValidatorTest extends CTestCase
|
||||
Yii::app()->setController(new CCaptchaValidatorTestController('CCaptchaValidatorTest'));
|
||||
|
||||
$rules = array(
|
||||
array('foo', 'captcha')
|
||||
array('foo', 'captcha', 'allowEmpty' => false),
|
||||
array('bar', 'captcha', 'allowEmpty' => true),
|
||||
);
|
||||
|
||||
$stub = $this->getMock('ModelMock', array('rules'));
|
||||
@@ -23,9 +24,11 @@ class CCaptchaValidatorTest extends CTestCase
|
||||
->will($this->returnValue($rules));
|
||||
|
||||
$stub->foo = null;
|
||||
$stub->bar = null;
|
||||
$this->assertFalse($stub->validate());
|
||||
|
||||
$stub->foo = array();
|
||||
$stub->bar = array();
|
||||
$this->assertFalse($stub->validate());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user