Commit 3631890c by Carsten Brandt

fixed failing validator tests

parent 7e1dd672
......@@ -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
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValueException()
{
......
......@@ -10,6 +10,12 @@ use yiiunit\TestCase;
class DateValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testEnsureMessageIsSet()
{
$val = new DateValidator;
......
......@@ -8,6 +8,12 @@ use yiiunit\TestCase;
*/
class DefaultValueValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateAttribute()
{
$val = new DefaultValueValidator;
......
......@@ -11,6 +11,12 @@ use yiiunit\TestCase;
*/
class EmailValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$validator = new EmailValidator();
......
......@@ -18,6 +18,7 @@ class ExistValidatorTest extends DatabaseTestCase
public function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}
......
......@@ -9,6 +9,12 @@ use yiiunit\TestCase;
class FilterValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testAssureExceptionOnInit()
{
$this->setExpectedException('yii\base\InvalidConfigException');
......
......@@ -9,6 +9,12 @@ use yiiunit\TestCase;
class NumberValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testEnsureMessageOnInit()
{
$val = new NumberValidator;
......
......@@ -9,6 +9,12 @@ use yiiunit\TestCase;
class RangeValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testInitException()
{
$this->setExpectedException('yii\base\InvalidConfigException', 'The "range" property must be set.');
......
......@@ -9,6 +9,12 @@ use yiiunit\TestCase;
class RegularExpressionValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);
......
......@@ -8,6 +8,12 @@ use yiiunit\TestCase;
class RequiredValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValueWithDefaults()
{
$val = new RequiredValidator();
......
......@@ -19,6 +19,7 @@ class UniqueValidatorTest extends DatabaseTestCase
public function setUp()
{
parent::setUp();
$this->mockApplication();
ActiveRecord::$db = $this->getConnection();
}
......
......@@ -9,6 +9,12 @@ use yiiunit\TestCase;
*/
class UrlValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
public function testValidateValue()
{
$val = new UrlValidator;
......
......@@ -12,6 +12,11 @@ use yiiunit\TestCase;
class ValidatorTest extends TestCase
{
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
protected function getTestModel($additionalAttributes = [])
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment