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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
3bb73e54
Commit
3bb73e54
authored
Feb 25, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
aa3d92f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
YiiBaseTest.php
tests/unit/framework/YiiBaseTest.php
+26
-0
EmailValidatorTest.php
tests/unit/framework/validators/EmailValidatorTest.php
+29
-0
No files found.
tests/unit/framework/YiiBaseTest.php
0 → 100644
View file @
3bb73e54
<?php
namespace
yiiunit\framework
;
use
yiiunit\TestCase
;
/**
* YiiBaseTest
*/
class
YiiBaseTest
extends
TestCase
{
public
function
testAlias
()
{
}
public
function
testGetVersion
()
{
echo
\Yii
::
getVersion
();
$this
->
assertTrue
((
boolean
)
preg_match
(
'~\d+\.\d+(?:\.\d+)?(?:-\w+)?~'
,
\Yii
::
getVersion
()));
}
public
function
testPowered
()
{
$this
->
assertTrue
(
is_string
(
\Yii
::
powered
()));
}
}
tests/unit/framework/validators/EmailValidatorTest.php
0 → 100644
View file @
3bb73e54
<?php
namespace
yiiunit\framework\validators
;
use
yii\validators\EmailValidator
;
use
yiiunit\TestCase
;
/**
* EmailValidatorTest
*/
class
EmailValidatorTest
extends
TestCase
{
public
function
testValidateValue
()
{
$validator
=
new
EmailValidator
();
$this
->
assertTrue
(
$validator
->
validateValue
(
'sam@rmcreative.ru'
));
$this
->
assertTrue
(
$validator
->
validateValue
(
'5011@gmail.com'
));
$this
->
assertFalse
(
$validator
->
validateValue
(
'rmcreative.ru'
));
}
public
function
testValidateValueMx
()
{
$validator
=
new
EmailValidator
();
$validator
->
checkMX
=
true
;
$this
->
assertTrue
(
$validator
->
validateValue
(
'sam@rmcreative.ru'
));
$this
->
assertFalse
(
$validator
->
validateValue
(
'test@example.com'
));
}
}
\ No newline at end of file
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