-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
2 changed files
with
44 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,32 @@ class EmailAddressTest extends TestCase | |
{ | ||
/** | ||
* @expectedException \InvalidArgumentException | ||
* @expectedMessage nvalid email address: this_is_not_email_address | ||
* @expectedMessage Invalid email address: this_is_not_email_address | ||
*/ | ||
public function testConstructorReturnsExceptionIfUrlIsInvalid() | ||
public function testConstructorThrowsExceptionIfUrlIsInvalid() | ||
{ | ||
new EmailAddress('this_is_not_email_address'); | ||
} | ||
|
||
/** | ||
* @expectedException \InvalidArgumentException | ||
* @expectedMessage Invalid email address: [email protected]' | ||
*/ | ||
public function testConstructorValidatesStrict() | ||
{ | ||
new EmailAddress('[email protected]'); | ||
} | ||
|
||
/** | ||
* @expectedException \InvalidArgumentException | ||
* @expectedMessage Invalid email address: this_is_not_email_address | ||
*/ | ||
public function testConstructorValidatesSoft() | ||
{ | ||
new EmailAddress('[email protected]', true); | ||
new EmailAddress('this_is_not_email_address', true); | ||
} | ||
|
||
public function testGetterReturnsValueString() | ||
{ | ||
$this->assertSame('[email protected]', (new EmailAddress('[email protected]'))->emailAddress()); | ||
|