-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e32ed21
commit 7b9379b
Showing
4 changed files
with
59 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the eluceo/iCal package. | ||
* | ||
* (c) 2022 Markus Poerschke <markus@poerschke.nrw> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Eluceo\iCal\Unit\Domain\ValueObject; | ||
|
||
use Eluceo\iCal\Domain\ValueObject\EmailAddress; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class EmailAddressTest extends TestCase | ||
{ | ||
public function testValidEmail(): void | ||
{ | ||
$email = new EmailAddress('example@example.com'); | ||
|
||
self::assertEquals('mailto:example@example.com', $email->toUri()->getUri()); | ||
} | ||
|
||
public function testInvalidEmail(): void | ||
{ | ||
self::expectException(\InvalidArgumentException::class); | ||
self::expectExceptionMessage('example@example@example.com is no valid e-mail address'); | ||
|
||
new EmailAddress('example@example@example.com'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters