Fix unit tests

This commit is contained in:
Romain Neutron
2013-01-28 19:31:26 +01:00
parent 2fb0c60157
commit aa18c48306
43 changed files with 582 additions and 256 deletions

View File

@@ -50,7 +50,10 @@ class Emitter implements EmitterInterface
public static function fromUser(\User_Adapter $user)
{
if (!\Swift_Validate::email($user->get_email())) {
throw new InvalidArgumentException(sprintf('User provided does not have a valid e-mail address'));
throw new InvalidArgumentException(sprintf(
'User provided does not have a valid e-mail address (%s)',
$user->get_email()
));
}
return new static($user->get_display_name(), $user->get_email());

View File

@@ -50,7 +50,10 @@ class Receiver implements ReceiverInterface
public static function fromUser(\User_Adapter $user)
{
if (!\Swift_Validate::email($user->get_email())) {
throw new InvalidArgumentException(sprintf('User provided does not have a valid e-mail address'));
throw new InvalidArgumentException(sprintf(
'User provided does not have a valid e-mail address (%s)',
$user->get_email()
));
}
return new static($user->get_display_name(), $user->get_email());