From 47a5a93e3e9ca2f966b932e6ea0a381b4d918945 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 13 Sep 2020 11:04:13 +0200 Subject: [PATCH 1/2] fix filename being cleaned up at end of tests --- .../Tests/Command/CacheClearCommand/CacheClearCommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php index 8a740413c1..41769f49d1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php @@ -38,7 +38,7 @@ class CacheClearCommandTest extends TestCase protected function tearDown(): void { $this->fs->remove($this->kernel->getProjectDir()); - $this->fs->remove(__DIR__.'/Fixture/preload.php'); + $this->fs->remove(__DIR__.'/Fixture/.preload.php'); } public function testCacheIsFreshAfterCacheClearedWithWarmup() From 63bc620efac13f3f383c073ff5c7c46dc139bd3c Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Mon, 14 Sep 2020 16:48:28 +0200 Subject: [PATCH 2/2] [Messenger] Improve error message readability Since slashes are escaped, vhosts are not very readable. --- .../Messenger/Tests/Transport/AmqpExt/ConnectionTest.php | 2 +- .../Component/Messenger/Transport/AmqpExt/Connection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php index aad12f020f..6488e5fa54 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/ConnectionTest.php @@ -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), diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php index 2821c34ad9..687d6169d6 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php @@ -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);