Commit a81480d3 by Suralc

Improved ValidatorTest organization.

parent b5472c20
<?php
namespace yiiunit\framework\validators;
namespace yiiunit\data\validators\models;
use yii\base\Model;
......@@ -11,6 +11,25 @@ class FakedValidationModel extends Model
{
private $attr = array();
public $val_attr_a;
public $val_attr_b;
public $val_attr_c;
public $val_attr_d;
public function rules()
{
return array(
array('val_attr_a, val_attr_b', 'required', 'on' => 'reqTest'),
array('val_attr_c', 'integer'),
);
}
public function inlineVal($attribute, $params = array())
{
return true;
}
public function __get($name)
{
if (stripos($name, 'attr') === 0) {
......
<?php
namespace yiiunit\framework\validators;
use yiiunit\framework\validators\FakedValidationModel;
use yiiunit\data\validators\models\FakedValidationModel;
use yii\validators\BooleanValidator;
use yiiunit\TestCase;
require_once __DIR__ . '/FakedValidationModel.php';
/**
* BooleanValidatorTest
*/
......
......@@ -3,9 +3,9 @@ namespace yiiunit\framework\validators;
use yii\base\InvalidConfigException;
use yii\validators\CompareValidator;
use yiiunit\data\validators\models\FakedValidationModel;
use yiiunit\TestCase;
require_once __DIR__ . '/FakedValidationModel.php';
class CompareValidatorTest extends TestCase
......
......@@ -4,9 +4,9 @@ namespace yiiunit\framework\validators;
use DateTime;
use yii\validators\DateValidator;
use yiiunit\data\validators\models\FakedValidationModel;
use yiiunit\TestCase;
require_once __DIR__ . '/FakedValidationModel.php';
class DateValidatorTest extends TestCase
{
......
......@@ -2,6 +2,7 @@
namespace yiiunit\framework\validators;
use yii\validators\EmailValidator;
use yiiunit\data\validators\models\FakedValidationModel;
use yiiunit\TestCase;
/**
......
......@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
use yii\validators\NumberValidator;
use yiiunit\data\validators\models\FakedValidationModel;
use yiiunit\TestCase;
class NumberValidatorTest extends TestCase
......
......@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
use yii\validators\StringValidator;
use yiiunit\data\validators\models\FakedValidationModel;
use yiiunit\TestCase;
class StringValidatorTest extends TestCase
......
<?php
namespace yiiunit\framework\validators;
use yiiunit\framework\validators\FakedValidationModel;
use yiiunit\data\validators\models\FakedValidationModel;
use yii\validators\UrlValidator;
use yiiunit\TestCase;
require_once __DIR__ . '/FakedValidationModel.php';
/**
* UrlValidatorTest
*/
......
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