Skip to content

Commit

Permalink
Support escaping on newer symfony/console versions, fixes #10499
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 2, 2022
1 parent e8a1e25 commit 4ce11ab
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -12,7 +12,9 @@

namespace Composer\Test\Installer;

use Composer\InstalledVersions;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\Semver\VersionParser;
use Composer\Test\TestCase;

/**
Expand Down Expand Up @@ -186,9 +188,12 @@ public function testOutputIgnoresFormatting()
->method('write')
->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))
->method('write')
->with(' - <info>target2</info>: \\<bg=green>Like us on Facebook\\</>');
->with($expectedWrite);

$this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE);
}
Expand Down

0 comments on commit 4ce11ab

Please sign in to comment.