diff --git a/tests/unit/framework/YiiBaseTest.php b/tests/unit/framework/YiiBaseTest.php new file mode 100644 index 0000000..df12bf9 --- /dev/null +++ b/tests/unit/framework/YiiBaseTest.php @@ -0,0 +1,26 @@ +assertTrue((boolean)preg_match('~\d+\.\d+(?:\.\d+)?(?:-\w+)?~', \Yii::getVersion())); + } + + public function testPowered() + { + $this->assertTrue(is_string(\Yii::powered())); + } +} diff --git a/tests/unit/framework/validators/EmailValidatorTest.php b/tests/unit/framework/validators/EmailValidatorTest.php new file mode 100644 index 0000000..fbc2f53 --- /dev/null +++ b/tests/unit/framework/validators/EmailValidatorTest.php @@ -0,0 +1,28 @@ +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