mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-04 15:24:07 +01:00
19 lines
432 B
PHP
19 lines
432 B
PHP
<?php
|
|
require 'ValidatorTestModel.php';
|
|
|
|
class CEmailValidatorTest extends CTestCase
|
|
{
|
|
public function testEmpty()
|
|
{
|
|
$model = new ValidatorTestModel();
|
|
$model->validate(array('email'));
|
|
$this->assertArrayHasKey('email', $model->getErrors());
|
|
}
|
|
|
|
public function testNumericEmail()
|
|
{
|
|
$emailValidator = new CEmailValidator();
|
|
$result = $emailValidator->validateValue("5011@gmail.com");
|
|
$this->assertTrue($result);
|
|
}
|
|
} |