1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Update tests

This commit is contained in:
Jordi Boggiano 2024-02-07 22:37:22 +01:00
parent 754f2868fb
commit df8f9f05a3
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
2 changed files with 40 additions and 23 deletions

View file

@ -210,6 +210,14 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
return new ApplicationTester($application);
}
/**
* Trims the entire string but also the trailing spaces off of every line
*/
protected function trimLines(string $str): string
{
return trim(Preg::replace('{^(.*?) *$}m', '$1', $str));
}
protected static function getVersionParser(): VersionParser
{
if (!self::$parser) {