1
0
Fork 0
This repository has been archived on 2021-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
my-todo-list/tests/EmailTest.php
2021-09-16 22:45:25 +02:00

27 lines
719 B
PHP

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use MMK2410\MyTodoList\Email;
final class EmailTest extends TestCase
{
private $email = 'user@example.com';
public function testCanBeCreatedFromValidEmailAddress(): void {
$this->assertInstanceOf(
Email::class,
Email::fromString($this->email)
);
}
public function testCannotBeCreatedFromInvalidEmailAddress(): void {
$this->expectException(InvalidArgumentException::class);
Email::fromString('invalid');
}
public function testCanBeUsedAsString(): void {
$this->assertEquals(
$this->email,
Email::fromString($this->email)
);
}
}