-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathEmailTest.php
More file actions
31 lines (25 loc) · 844 Bytes
/
EmailTest.php
File metadata and controls
31 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace Rakit\Validation\Tests\Rules;
use Rakit\Validation\Rules\Email;
use PHPUnit\Framework\TestCase;
class EmailTest extends TestCase
{
public function setUp()
{
$this->rule = new Email;
}
public function testValids()
{
$this->assertTrue($this->rule->check('johndoe@gmail.com'));
$this->assertTrue($this->rule->check('johndoe@foo.bar'));
$this->assertTrue($this->rule->check('foo123123@foo.bar.baz'));
}
public function testInvalids()
{
$this->assertFalse($this->rule->check(1));
$this->assertFalse($this->rule->check('john doe@gmail.com'));
$this->assertFalse($this->rule->check('johndoe'));
$this->assertFalse($this->rule->check('johndoe.gmail.com'));
$this->assertFalse($this->rule->check('johndoe.gmail.com'));
}
}