1
0
Fork 0

Support escaping on newer symfony/console versions, fixes #10499

pull/10512/head
Jordi Boggiano 2022-02-02 15:01:55 +01:00
parent e8a1e25e9d
commit 4ce11ab4ab
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,9 @@
namespace Composer\Test\Installer; namespace Composer\Test\Installer;
use Composer\InstalledVersions;
use Composer\Installer\SuggestedPackagesReporter; use Composer\Installer\SuggestedPackagesReporter;
use Composer\Semver\VersionParser;
use Composer\Test\TestCase; use Composer\Test\TestCase;
/** /**
@ -186,9 +188,12 @@ class SuggestedPackagesReporterTest extends TestCase
->method('write') ->method('write')
->with(' - <info>target1</info>: [1;37;42m Like us on Facebook [0m'); ->with(' - <info>target1</info>: [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')
? ' - <info>target2</info>: \\<bg=green\\>Like us on Facebook\\</\\>'
: ' - <info>target2</info>: \\<bg=green>Like us on Facebook\\</>';
$this->io->expects($this->at(2)) $this->io->expects($this->at(2))
->method('write') ->method('write')
->with(' - <info>target2</info>: \\<bg=green>Like us on Facebook\\</>'); ->with($expectedWrite);
$this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE);
} }