Commit 3bb73e54 by Alexander Makarov

more tests

parent aa3d92f7
<?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()));
}
}
<?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
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