mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-17 16:01:15 +08:00

Appended newlines to every PHP document that did not have a newline as the last character in the file.
29 lines
714 B
PHP
29 lines
714 B
PHP
<?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'));
|
|
}
|
|
}
|