@ -10,6 +10,12 @@ use yiiunit\TestCase;
*/
class BooleanValidatorTest extends TestCase
{
protected function setUp()
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
$val = new BooleanValidator;
@ -10,6 +10,11 @@ use yiiunit\TestCase;
class CompareValidatorTest extends TestCase
public function testValidateValueException()
class DateValidatorTest extends TestCase
public function testEnsureMessageIsSet()
$val = new DateValidator;
@ -8,6 +8,12 @@ use yiiunit\TestCase;
class DefaultValueValidatorTest extends TestCase
public function testValidateAttribute()
$val = new DefaultValueValidator;
@ -11,6 +11,12 @@ use yiiunit\TestCase;
class EmailValidatorTest extends TestCase
$validator = new EmailValidator();
@ -18,6 +18,7 @@ class ExistValidatorTest extends DatabaseTestCase
public function setUp()
ActiveRecord::$db = $this->getConnection();
@ -9,6 +9,12 @@ use yiiunit\TestCase;
class FilterValidatorTest extends TestCase
public function testAssureExceptionOnInit()
$this->setExpectedException('yii\base\InvalidConfigException');
class NumberValidatorTest extends TestCase
public function testEnsureMessageOnInit()
$val = new NumberValidator;
class RangeValidatorTest extends TestCase
public function testInitException()
$this->setExpectedException('yii\base\InvalidConfigException', 'The "range" property must be set.');
class RegularExpressionValidatorTest extends TestCase
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);
class RequiredValidatorTest extends TestCase
public function testValidateValueWithDefaults()
$val = new RequiredValidator();
@ -19,6 +19,7 @@ class UniqueValidatorTest extends DatabaseTestCase
class UrlValidatorTest extends TestCase
$val = new UrlValidator;
@ -12,6 +12,11 @@ use yiiunit\TestCase;
class ValidatorTest extends TestCase
protected function getTestModel($additionalAttributes = [])