From 4ce11ab4ab00777c744fd928cd8123f21fcd0074 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 2 Feb 2022 15:01:55 +0100 Subject: [PATCH] Support escaping on newer symfony/console versions, fixes #10499 --- .../Test/Installer/SuggestedPackagesReporterTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php index c6f5b8721..dd5929d93 100644 --- a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php +++ b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php @@ -12,7 +12,9 @@ namespace Composer\Test\Installer; +use Composer\InstalledVersions; use Composer\Installer\SuggestedPackagesReporter; +use Composer\Semver\VersionParser; use Composer\Test\TestCase; /** @@ -186,9 +188,12 @@ class SuggestedPackagesReporterTest extends TestCase ->method('write') ->with(' - target1: [1;37;42m Like us on Facebook [0m'); + $expectedWrite = InstalledVersions::satisfies(new VersionParser(), 'symfony/console', '^4.4.37 || ~5.3.14 || ^5.4.3 || ^6.0.3') + ? ' - target2: \\Like us on Facebook\\' + : ' - target2: \\Like us on Facebook\\'; $this->io->expects($this->at(2)) ->method('write') - ->with(' - target2: \\Like us on Facebook\\'); + ->with($expectedWrite); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); }