minor #38186 [Messenger][minor ]Improve connection message readability (4.4) (l-vo)

This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger][minor ]Improve connection message readability (4.4)

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Same as #38185 but for 4.4.
I created 2 PR since bridges directory has moved in 5.1 (to ease merge)

Commits
-------

63bc620efa [Messenger] Improve error message readability
This commit is contained in:
Fabien Potencier 2020-09-14 17:00:55 +02:00
commit e368bb4517
2 changed files with 2 additions and 2 deletions

View File

@ -449,7 +449,7 @@ class ConnectionTest extends TestCase
public function testObfuscatePasswordInDsn()
{
$this->expectException('AMQPException');
$this->expectExceptionMessage('Could not connect to the AMQP server. Please verify the provided DSN. ({"host":"localhost","port":5672,"vhost":"\/","login":"user","password":"********"})');
$this->expectExceptionMessage('Could not connect to the AMQP server. Please verify the provided DSN. ({"host":"localhost","port":5672,"vhost":"/","login":"user","password":"********"})');
$factory = new TestAmqpFactory(
$amqpConnection = $this->createMock(\AMQPConnection::class),
$amqpChannel = $this->createMock(\AMQPChannel::class),

View File

@ -384,7 +384,7 @@ class Connection
$credentials['password'] = '********';
unset($credentials['delay']);
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s).', json_encode($credentials)), 0, $e);
throw new \AMQPException(sprintf('Could not connect to the AMQP server. Please verify the provided DSN. (%s).', json_encode($credentials, \JSON_UNESCAPED_SLASHES)), 0, $e);
}
$this->amqpChannel = $this->amqpFactory->createChannel($connection);