Skip to content

Commit

Permalink
finetune assertion and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Jul 24, 2021
1 parent c3e9fa3 commit 5cc0db7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/EmailAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function assertPlusAlias(string $expected, $actual): void
{
PHPUnit::assertIsString($actual);
[$localPart] = explode('@', $actual, 2);
[$mailbox, $alias] = explode('+', $localPart, 2);
[, $alias] = explode('+', $localPart, 2);
PHPUnit::assertSame($expected, $alias);
}
}
4 changes: 2 additions & 2 deletions tests/EmailAssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function it_can_validate_local_part(): void
public static function it_can_validate_plus_mailbox(): void
{
$mailbox = self::randomString();
$alias = self::randomBool();
$alias = self::randomString();
$email = $mailbox.'+'.$alias.'@email.com';

EmailAssertions::assertPlusMailbox($mailbox, $email);
Expand All @@ -64,7 +64,7 @@ public static function it_can_validate_plus_mailbox(): void
public static function it_can_validate_plus_alias(): void
{
$mailbox = self::randomString();
$alias = self::randomBool();
$alias = self::randomString();
$email = $mailbox.'+'.$alias.'@email.com';

EmailAssertions::assertPlusAlias($alias, $email);
Expand Down

0 comments on commit 5cc0db7

Please sign in to comment.