Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
a81480d3
Commit
a81480d3
authored
Aug 06, 2013
by
Suralc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved ValidatorTest organization.
parent
b5472c20
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
7 deletions
+27
-7
FakedValidationModel.php
tests/unit/data/validators/models/FakedValidationModel.php
+20
-1
BooleanValidatorTest.php
tests/unit/framework/validators/BooleanValidatorTest.php
+1
-2
CompareValidatorTest.php
tests/unit/framework/validators/CompareValidatorTest.php
+1
-1
DateValidatorTest.php
tests/unit/framework/validators/DateValidatorTest.php
+1
-1
EmailValidatorTest.php
tests/unit/framework/validators/EmailValidatorTest.php
+1
-0
NumberValidatorTest.php
tests/unit/framework/validators/NumberValidatorTest.php
+1
-0
StringValidatorTest.php
tests/unit/framework/validators/StringValidatorTest.php
+1
-0
UrlValidatorTest.php
tests/unit/framework/validators/UrlValidatorTest.php
+1
-2
No files found.
tests/unit/
framework/validator
s/FakedValidationModel.php
→
tests/unit/
data/validators/model
s/FakedValidationModel.php
View file @
a81480d3
<?php
<?php
namespace
yiiunit\
framework\validator
s
;
namespace
yiiunit\
data\validators\model
s
;
use
yii\base\Model
;
use
yii\base\Model
;
...
@@ -11,6 +11,25 @@ class FakedValidationModel extends Model
...
@@ -11,6 +11,25 @@ class FakedValidationModel extends Model
{
{
private
$attr
=
array
();
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
)
public
function
__get
(
$name
)
{
{
if
(
stripos
(
$name
,
'attr'
)
===
0
)
{
if
(
stripos
(
$name
,
'attr'
)
===
0
)
{
...
...
tests/unit/framework/validators/BooleanValidatorTest.php
View file @
a81480d3
<?php
<?php
namespace
yiiunit\framework\validators
;
namespace
yiiunit\framework\validators
;
use
yiiunit\
framework\validator
s\FakedValidationModel
;
use
yiiunit\
data\validators\model
s\FakedValidationModel
;
use
yii\validators\BooleanValidator
;
use
yii\validators\BooleanValidator
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
require_once
__DIR__
.
'/FakedValidationModel.php'
;
/**
/**
* BooleanValidatorTest
* BooleanValidatorTest
*/
*/
...
...
tests/unit/framework/validators/CompareValidatorTest.php
View file @
a81480d3
...
@@ -3,9 +3,9 @@ namespace yiiunit\framework\validators;
...
@@ -3,9 +3,9 @@ namespace yiiunit\framework\validators;
use
yii\base\InvalidConfigException
;
use
yii\base\InvalidConfigException
;
use
yii\validators\CompareValidator
;
use
yii\validators\CompareValidator
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
require_once
__DIR__
.
'/FakedValidationModel.php'
;
class
CompareValidatorTest
extends
TestCase
class
CompareValidatorTest
extends
TestCase
...
...
tests/unit/framework/validators/DateValidatorTest.php
View file @
a81480d3
...
@@ -4,9 +4,9 @@ namespace yiiunit\framework\validators;
...
@@ -4,9 +4,9 @@ namespace yiiunit\framework\validators;
use
DateTime
;
use
DateTime
;
use
yii\validators\DateValidator
;
use
yii\validators\DateValidator
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
require_once
__DIR__
.
'/FakedValidationModel.php'
;
class
DateValidatorTest
extends
TestCase
class
DateValidatorTest
extends
TestCase
{
{
...
...
tests/unit/framework/validators/EmailValidatorTest.php
View file @
a81480d3
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
yiiunit\framework\validators
;
namespace
yiiunit\framework\validators
;
use
yii\validators\EmailValidator
;
use
yii\validators\EmailValidator
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
/**
/**
...
...
tests/unit/framework/validators/NumberValidatorTest.php
View file @
a81480d3
...
@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
...
@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
use
yii\validators\NumberValidator
;
use
yii\validators\NumberValidator
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
class
NumberValidatorTest
extends
TestCase
class
NumberValidatorTest
extends
TestCase
...
...
tests/unit/framework/validators/StringValidatorTest.php
View file @
a81480d3
...
@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
...
@@ -4,6 +4,7 @@ namespace yiiunit\framework\validators;
use
yii\validators\StringValidator
;
use
yii\validators\StringValidator
;
use
yiiunit\data\validators\models\FakedValidationModel
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
class
StringValidatorTest
extends
TestCase
class
StringValidatorTest
extends
TestCase
...
...
tests/unit/framework/validators/UrlValidatorTest.php
View file @
a81480d3
<?php
<?php
namespace
yiiunit\framework\validators
;
namespace
yiiunit\framework\validators
;
use
yiiunit\
framework\validator
s\FakedValidationModel
;
use
yiiunit\
data\validators\model
s\FakedValidationModel
;
use
yii\validators\UrlValidator
;
use
yii\validators\UrlValidator
;
use
yiiunit\TestCase
;
use
yiiunit\TestCase
;
require_once
__DIR__
.
'/FakedValidationModel.php'
;
/**
/**
* UrlValidatorTest
* UrlValidatorTest
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment