Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Commit

Permalink
tweaked an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 18, 2019
1 parent 218c925 commit ad4a89a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/SwiftmailerTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public static function resolveOptions(array $options)
];

if (isset($options['url'])) {
if (false === ($parts = parse_url($options['url']))) {
throw new \InvalidArgumentException(sprintf('Supplied url [%s] is not a valid format.', $options['url']));
if (false === $parts = parse_url($options['url'])) {
throw new \InvalidArgumentException(sprintf('The Swiftmailer URL "%s" is not a valid.', $options['url']));
}
if (isset($parts['scheme'])) {
$options['transport'] = $parts['scheme'];
Expand Down
8 changes: 2 additions & 6 deletions Tests/DependencyInjection/SwiftmailerTransportFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function testCreateTransportWithSmtpAndWithoutRequestContext()

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Supplied url [smtp://localhost:25&auth_mode=cra-md5] is not a valid format.
* @expectedExceptionMessage The Swiftmailer URL "smtp://localhost:25&auth_mode=cra-md5" is not a valid.
*/
public function testCreateTransportWithBadURLFormat()
{
Expand All @@ -181,11 +181,7 @@ public function testCreateTransportWithBadURLFormat()
'auth_mode' => null,
];

SwiftmailerTransportFactory::createTransport(
$options,
null,
new \Swift_Events_SimpleEventDispatcher()
);
SwiftmailerTransportFactory::createTransport($options, null, new \Swift_Events_SimpleEventDispatcher());
}

/**
Expand Down

0 comments on commit ad4a89a

Please sign in to comment.