1
0
Fork 0

Allow ProcessExecutor to receive commands as arrays, refs #6552 (#10435)

pull/10449/head
Jordi Boggiano 2022-01-06 13:56:12 +01:00 committed by GitHub
parent 9d6cf5835b
commit 5e4a8a882d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 8957 deletions

File diff suppressed because it is too large Load Diff

View File

@ -270,21 +270,11 @@ parameters:
count: 1
path: ../src/Composer/Autoload/ClassMapGenerator.php
-
message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Autoload/ClassMapGenerator.php
-
message: "#^Parameter \\#3 \\$baseNamespace of static method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:filterByNamespace\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: ../src/Composer/Autoload/ClassMapGenerator.php
-
message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#"
count: 1
path: ../src/Composer/Autoload/ClassMapGenerator.php
-
message: "#^Parameter \\#5 \\$basePath of static method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:filterByNamespace\\(\\) expects string, array\\<string\\>\\|string\\|Traversable\\<mixed, SplFileInfo\\> given\\.$#"
count: 1
@ -295,11 +285,6 @@ parameters:
count: 2
path: ../src/Composer/Cache.php
-
message: "#^Only booleans are allowed in a negated boolean, int given\\.$#"
count: 1
path: ../src/Composer/Cache.php
-
message: "#^Only booleans are allowed in a negated boolean, int\\<0, 50\\> given\\.$#"
count: 1
@ -320,11 +305,6 @@ parameters:
count: 1
path: ../src/Composer/Cache.php
-
message: "#^Parameter \\#2 \\$time of function touch expects int, int\\|false given\\.$#"
count: 1
path: ../src/Composer/Cache.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 1
@ -370,11 +350,6 @@ parameters:
count: 1
path: ../src/Composer/Command/ArchiveCommand.php
-
message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Helper\\\\TableStyle and 'setVerticalBorderCh…' will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Command/BaseCommand.php
-
message: "#^Instanceof between Composer\\\\Console\\\\Application and Composer\\\\Console\\\\Application will always evaluate to true\\.$#"
count: 2
@ -980,11 +955,6 @@ parameters:
count: 1
path: ../src/Composer/Command/HomeCommand.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 1
path: ../src/Composer/Command/InitCommand.php
-
message: "#^Argument of an invalid type array\\<int, string\\>\\|false supplied for foreach, only iterables are supported\\.$#"
count: 1
@ -995,11 +965,6 @@ parameters:
count: 1
path: ../src/Composer/Command/InitCommand.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Command/InitCommand.php
-
message: "#^Cannot call method get\\(\\) on Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperSet\\|null\\.$#"
count: 1
@ -1235,11 +1200,6 @@ parameters:
count: 2
path: ../src/Composer/Command/LicensesCommand.php
-
message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Helper\\\\TableStyle and 'setVerticalBorderCh…' will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Command/LicensesCommand.php
-
message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#"
count: 1
@ -1715,11 +1675,6 @@ parameters:
count: 1
path: ../src/Composer/Command/SelfUpdateCommand.php
-
message: "#^Parameter \\#1 \\$key_identifier of function openssl_free_key expects resource, resource\\|false given\\.$#"
count: 1
path: ../src/Composer/Command/SelfUpdateCommand.php
-
message: "#^Parameter \\#1 \\$old_name of function rename expects string, string\\|false given\\.$#"
count: 1
@ -1740,11 +1695,6 @@ parameters:
count: 1
path: ../src/Composer/Command/SelfUpdateCommand.php
-
message: "#^Parameter \\#3 \\$pub_key_id of function openssl_verify expects resource\\|string, resource\\|false given\\.$#"
count: 1
path: ../src/Composer/Command/SelfUpdateCommand.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 2
@ -1865,11 +1815,6 @@ parameters:
count: 1
path: ../src/Composer/Command/ShowCommand.php
-
message: "#^Offset 'latest\\-status' does not exist on array\\{name\\: string, version\\?\\: string, latest\\: string, latest\\-status\\?\\: string, description\\?\\: string\\|null, path\\?\\: string\\|false, warning\\?\\: non\\-empty\\-string\\}\\.$#"
count: 1
path: ../src/Composer/Command/ShowCommand.php
-
message: "#^Only booleans are allowed in &&, Composer\\\\Composer\\|null given on the right side\\.$#"
count: 1
@ -2430,11 +2375,6 @@ parameters:
count: 1
path: ../src/Composer/Compiler.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 3
path: ../src/Composer/Compiler.php
-
message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#"
count: 1
@ -2465,11 +2405,6 @@ parameters:
count: 1
path: ../src/Composer/Compiler.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$config\\. Use \\$this directly in the function body\\.$#"
count: 1
path: ../src/Composer/Config.php
-
message: "#^Array \\(array\\<string, true\\>\\) does not accept key 0\\|string\\.$#"
count: 1
@ -2565,11 +2500,6 @@ parameters:
count: 1
path: ../src/Composer/Console/Application.php
-
message: "#^Call to function method_exists\\(\\) with \\$this\\(Composer\\\\Console\\\\Application\\) and 'areExceptionsCaught' will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Console/Application.php
-
message: "#^Instanceof between Composer\\\\Command\\\\BaseCommand and Composer\\\\Command\\\\BaseCommand will always evaluate to true\\.$#"
count: 1
@ -2720,11 +2650,6 @@ parameters:
count: 1
path: ../src/Composer/DependencyResolver/Decisions.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$policy\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/DependencyResolver/DefaultPolicy.php
-
message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#"
count: 1
@ -3235,21 +3160,11 @@ parameters:
count: 2
path: ../src/Composer/DependencyResolver/Transaction.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 3
path: ../src/Composer/Downloader/ArchiveDownloader.php
-
message: "#^Parameter \\#2 \\$path of method Composer\\\\Downloader\\\\FileDownloader\\:\\:removeCleanupPath\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Downloader/ArchiveDownloader.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Downloader/DownloadManager.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
@ -3315,11 +3230,6 @@ parameters:
count: 1
path: ../src/Composer/Downloader/DownloadManager.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 4
path: ../src/Composer/Downloader/FileDownloader.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
@ -3750,11 +3660,6 @@ parameters:
count: 2
path: ../src/Composer/Downloader/VcsDownloader.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Downloader/ZipDownloader.php
-
message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#"
count: 3
@ -4210,11 +4115,6 @@ parameters:
count: 1
path: ../src/Composer/Installer/BinaryInstaller.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$installManager\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Installer/InstallationManager.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
@ -4325,11 +4225,6 @@ parameters:
count: 2
path: ../src/Composer/Installer/InstallationManager.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 1
path: ../src/Composer/Installer/LibraryInstaller.php
-
message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#"
count: 1
@ -4370,11 +4265,6 @@ parameters:
count: 1
path: ../src/Composer/Installer/NoopInstaller.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Installer/PluginInstaller.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
@ -4422,7 +4312,7 @@ parameters:
-
message: "#^Method Composer\\\\Json\\\\JsonFile\\:\\:encode\\(\\) should return string but returns string\\|false\\.$#"
count: 2
count: 1
path: ../src/Composer/Json/JsonFile.php
-
@ -4465,31 +4355,11 @@ parameters:
count: 1
path: ../src/Composer/Json/JsonFile.php
-
message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFormatter\\:\\:format\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Json/JsonFile.php
-
message: "#^Parameter \\#1 \\$version1 of function version_compare expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Json/JsonFile.php
-
message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Json/JsonFile.php
-
message: "#^Only booleans are allowed in an if condition, int\\<0, 1\\> given\\.$#"
count: 1
path: ../src/Composer/Json/JsonFormatter.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Json/JsonManipulator.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
@ -4945,11 +4815,6 @@ parameters:
count: 1
path: ../src/Composer/Package/Locker.php
-
message: "#^Parameter \\#1 \\$str of function md5 expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Package/Locker.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 3
@ -5265,11 +5130,6 @@ parameters:
count: 1
path: ../src/Composer/Repository/ArtifactRepository.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$repo\\. Use \\$this directly in the function body\\.$#"
count: 3
path: ../src/Composer/Repository/ComposerRepository.php
-
message: "#^Argument of an invalid type array\\<string, Composer\\\\Package\\\\PackageInterface\\>\\|null supplied for foreach, only iterables are supported\\.$#"
count: 1
@ -6495,11 +6355,6 @@ parameters:
count: 1
path: ../src/Composer/Util/ErrorHandler.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 1
path: ../src/Composer/Util/Filesystem.php
-
message: "#^Cannot call method getPathname\\(\\) on SplFileInfo\\|string\\.$#"
count: 1
@ -6615,11 +6470,6 @@ parameters:
count: 1
path: ../src/Composer/Util/Git.php
-
message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#"
count: 1
path: ../src/Composer/Util/Git.php
-
message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#"
count: 1
@ -6640,11 +6490,6 @@ parameters:
count: 2
path: ../src/Composer/Util/Git.php
-
message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Util/Git.php
-
message: "#^Parameter \\#1 \\$str of function rawurlencode expects string, string\\|null given\\.$#"
count: 17
@ -7020,11 +6865,6 @@ parameters:
count: 1
path: ../src/Composer/Util/Http/Response.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$downloader\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Util/HttpDownloader.php
-
message: "#^Argument of an invalid type array\\<array\\<string, string\\>\\>\\|string supplied for foreach, only iterables are supported\\.$#"
count: 1
@ -7100,11 +6940,6 @@ parameters:
count: 1
path: ../src/Composer/Util/HttpDownloader.php
-
message: "#^Only booleans are allowed in &&, Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null given on the left side\\.$#"
count: 1
path: ../src/Composer/Util/HttpDownloader.php
-
message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null given\\.$#"
count: 1
@ -7240,11 +7075,6 @@ parameters:
count: 1
path: ../src/Composer/Util/NoProxyPattern.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 1
path: ../src/Composer/Util/Perforce.php
-
message: "#^Only booleans are allowed in a negated boolean, array\\<string, string\\> given\\.$#"
count: 1
@ -7335,49 +7165,19 @@ parameters:
count: 2
path: ../src/Composer/Util/Platform.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 2
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Method Composer\\\\Util\\\\ProcessExecutor\\:\\:doExecute\\(\\) should return int but returns int\\|null\\.$#"
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#"
count: 2
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#"
count: 2
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Only booleans are allowed in a negated boolean, int given\\.$#"
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Parameter \\#1 \\$filename of function is_dir expects string, string\\|false given\\.$#"
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Parameter \\#2 \\$cwd of static method Symfony\\\\Component\\\\Process\\\\Process\\:\\:fromShellCommandline\\(\\) expects string\\|null, string\\|false\\|null given\\.$#"
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 2
count: 1
path: ../src/Composer/Util/ProcessExecutor.php
-
@ -7387,7 +7187,7 @@ parameters:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 10
count: 8
path: ../src/Composer/Util/RemoteFilesystem.php
-
@ -7450,11 +7250,6 @@ parameters:
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Only booleans are allowed in an if condition, array\\<string, string\\>\\|null given\\.$#"
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Only booleans are allowed in an if condition, string given\\.$#"
count: 2
@ -7515,11 +7310,6 @@ parameters:
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Parameter \\#2 \\$hostname of static method Composer\\\\Util\\\\TlsHelper\\:\\:checkCertificateHost\\(\\) expects string, string\\|false\\|null given\\.$#"
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Parameter \\#5 \\$maxlen of function file_get_contents expects int\\<0, max\\>, int given\\.$#"
count: 1
@ -7535,11 +7325,6 @@ parameters:
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 1
path: ../src/Composer/Util/RemoteFilesystem.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
@ -7675,11 +7460,6 @@ parameters:
count: 1
path: ../src/Composer/Util/TlsHelper.php
-
message: "#^Parameter \\#1 \\$key of function openssl_pkey_get_details expects resource, resource\\|false given\\.$#"
count: 1
path: ../src/Composer/Util/TlsHelper.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
@ -7720,21 +7500,11 @@ parameters:
count: 2
path: ../src/bootstrap.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 2
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Call to method RecursiveDirectoryIterator\\:\\:getSubPathname\\(\\) with incorrect case\\: getSubPathName$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Cannot access offset int\\<0, max\\> on int\\|string\\.$#"
count: 3
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Method Composer\\\\Test\\\\AllFunctionalTest\\:\\:getTestFiles\\(\\) should return array\\<string, array\\<string\\>\\> but returns array\\<string, array\\<int, string\\|false\\>\\>\\.$#"
count: 1
@ -7760,41 +7530,11 @@ parameters:
count: 3
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#1 \\$haystack of function strpos expects string, int\\|string given\\.$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#1 \\$pattern of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertRegExp\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, int\\|string given\\.$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#1 \\$string of function substr expects string, int\\|string given\\.$#"
count: 2
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#2 \\$str of function explode expects string, int\\|string given\\.$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:split\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/AllFunctionalTest.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#"
count: 3
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Dynamic call to static method Composer\\\\Test\\\\Autoload\\\\AutoloadGeneratorTest\\:\\:assertFileContentEquals\\(\\)\\.$#"
count: 28
@ -7815,21 +7555,11 @@ parameters:
count: 2
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Parameter \\#1 \\$expected of static method Composer\\\\Test\\\\Autoload\\\\AutoloadGeneratorTest\\:\\:assertEqualsNormalized\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Parameter \\#1 \\$new_include_path of function set_include_path expects string, string\\|false given\\.$#"
count: 2
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Parameter \\#2 \\$actual of static method Composer\\\\Test\\\\Autoload\\\\AutoloadGeneratorTest\\:\\:assertEqualsNormalized\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#"
count: 8
@ -7845,11 +7575,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 1
path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
-
message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#"
count: 1
@ -8090,56 +7815,21 @@ parameters:
count: 1
path: ../tests/Composer/Test/Downloader/ArchiveDownloaderTest.php
-
message: "#^Only booleans are allowed in a ternary operator condition, Prophecy\\\\Prophecy\\\\ObjectProphecy\\|null given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/DownloadManagerTest.php
-
message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/DownloadManagerTest.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 6
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#"
count: 6
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#1 \\$directory of method Composer\\\\Util\\\\Filesystem\\:\\:removeDirectory\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#1 \\$filename of function is_dir expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#1 \\$filename of function is_file expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#1 \\$filename of function unlink expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#1 \\$promises of method Composer\\\\Util\\\\Loop\\:\\:wait\\(\\) expects array\\<React\\\\Promise\\\\PromiseInterface\\>, array\\<int, React\\\\Promise\\\\PromiseInterface\\|null\\> given\\.$#"
count: 5
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Parameter \\#2 \\$path of method Composer\\\\Downloader\\\\FileDownloader\\:\\:download\\(\\) expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php
-
message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#"
count: 3
@ -8236,8 +7926,7 @@ parameters:
path: ../tests/Composer/Test/IO/NullIOTest.php
-
message:
"""
message: """
#^Call to deprecated method getRawData\\(\\) of class Composer\\\\InstalledVersions\\:
Use getAllRawData\\(\\) instead which returns all datasets for all autoloaders present in the process\\. getRawData only returns the first dataset loaded, which may not be what you expect\\.$#
"""
@ -8339,11 +8028,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$fp of function fseek expects resource, resource\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false\\|null given\\.$#"
count: 1
@ -8354,26 +8038,11 @@ parameters:
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$source of function stream_get_contents expects resource, resource\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$str of function md5 expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#1 \\$stream of class Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput constructor expects resource, resource\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/InstallerTest.php
-
message: "#^Parameter \\#2 \\$fixturesDir of method Composer\\\\Test\\\\InstallerTest\\:\\:readTestFile\\(\\) expects string, string\\|false given\\.$#"
count: 1
@ -8409,31 +8078,11 @@ parameters:
count: 4
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#1 \\$file of function file_put_contents expects string, string\\|false given\\.$#"
count: 12
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#1 \\$filename of function unlink expects string, string\\|false given\\.$#"
count: 7
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#1 \\$path of class Composer\\\\Json\\\\JsonFile constructor expects string, string\\|false given\\.$#"
count: 5
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#1 \\$version1 of function version_compare expects string, string\\|false given\\.$#"
count: 1
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#2 \\$schemaFile of method Composer\\\\Json\\\\JsonFile\\:\\:validateSchema\\(\\) expects string\\|null, string\\|false given\\.$#"
count: 2
path: ../tests/Composer/Test/Json/JsonFileTest.php
-
message: "#^Parameter \\#1 \\$contents of class Composer\\\\Json\\\\JsonManipulator constructor expects string, string\\|false given\\.$#"
count: 1
@ -8474,11 +8123,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/Mock/InstallationManagerMock.php
-
message: "#^Only booleans are allowed in an elseif condition, array\\<string, \\(callable\\)\\|int\\|string\\|null\\> given\\.$#"
count: 1
path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php
-
message: "#^Only booleans are allowed in an if condition, string given\\.$#"
count: 2
@ -8495,7 +8139,7 @@ parameters:
path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php
-
message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$expectations \\(array\\<array\\{cmd\\: string, return\\: int, stdout\\: string, stderr\\: string, callback\\: \\(callable\\(\\)\\: mixed\\)\\|null\\}\\>\\|null\\) does not accept array\\<non\\-empty\\-array\\<literal\\-string&non\\-empty\\-string, \\(callable\\(\\)\\: mixed\\)\\|int\\|string\\|null\\>\\>\\.$#"
message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$expectations \\(array\\<array\\{cmd\\: array\\<int, string\\>\\|string, return\\: int, stdout\\: string, stderr\\: string, callback\\: \\(callable\\(\\)\\: mixed\\)\\|null\\}\\>\\|null\\) does not accept array\\<non\\-empty\\-array\\<literal\\-string&non\\-empty\\-string, array\\<int, string\\>\\|\\(callable\\(\\)\\: mixed\\)\\|int\\|string\\>\\>\\.$#"
count: 1
path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php
@ -8504,11 +8148,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/Mock/VersionGuesserMock.php
-
message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#"
count: 1
path: ../tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php
-
message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#"
count: 1
@ -8579,11 +8218,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/Package/Archiver/ZipArchiverTest.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#"
count: 1
path: ../tests/Composer/Test/Package/BasePackageTest.php
-
message: "#^Implicit array creation is not allowed \\- variable \\$provider does not exist\\.$#"
count: 1
@ -8594,36 +8228,11 @@ parameters:
count: 2
path: ../tests/Composer/Test/Package/Dumper/ArrayDumperTest.php
-
message: "#^Parameter \\#1 \\$manager of class Composer\\\\Package\\\\Loader\\\\RootPackageLoader constructor expects Composer\\\\Repository\\\\RepositoryManager, object given\\.$#"
count: 1
path: ../tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php
-
message: "#^Parameter \\#4 \\$versionGuesser of class Composer\\\\Package\\\\Loader\\\\RootPackageLoader constructor expects Composer\\\\Package\\\\Version\\\\VersionGuesser\\|null, object given\\.$#"
count: 1
path: ../tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php
-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true will always evaluate to true\\.$#"
count: 1
path: ../tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php
-
message: "#^Parameter \\#1 \\$str of function md5 expects string, string\\|false given\\.$#"
count: 4
path: ../tests/Composer/Test/Package/LockerTest.php
-
message: "#^Parameter \\#4 \\$composerFileContents of class Composer\\\\Package\\\\Locker constructor expects string, string\\|false given\\.$#"
count: 9
path: ../tests/Composer/Test/Package/LockerTest.php
-
message: "#^Parameter \\#1 \\$aliasOf of class Composer\\\\Package\\\\RootAliasPackage constructor expects Composer\\\\Package\\\\RootPackage, object given\\.$#"
count: 5
path: ../tests/Composer/Test/Package/RootAliasPackageTest.php
-
message: "#^Offset 'commit' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#"
count: 6
@ -8709,11 +8318,6 @@ parameters:
count: 2
path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php
-
message: "#^Instanceof between Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput and Symfony\\\\Component\\\\Console\\\\Input\\\\StreamableInputInterface will always evaluate to true\\.$#"
count: 1
path: ../tests/Composer/Test/Question/StrictConfirmationQuestionTest.php
-
message: "#^Parameter \\#1 \\$stream of class Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput constructor expects resource, resource\\|false given\\.$#"
count: 1
@ -8929,11 +8533,6 @@ parameters:
count: 2
path: ../tests/Composer/Test/Util/FilesystemTest.php
-
message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#"
count: 2
path: ../tests/Composer/Test/Util/GitTest.php
-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Util\\\\\\\\Http…' and Composer\\\\Util\\\\Http\\\\ProxyManager will always evaluate to true\\.$#"
count: 1
@ -8974,21 +8573,6 @@ parameters:
count: 2
path: ../tests/Composer/Test/Util/PerforceTest.php
-
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
count: 4
path: ../tests/Composer/Test/Util/PerforceTest.php
-
message: "#^Parameter \\#1 \\$fp of function fgets expects resource, resource\\|false given\\.$#"
count: 4
path: ../tests/Composer/Test/Util/PerforceTest.php
-
message: "#^Parameter \\#1 \\$fp of function rewind expects resource, resource\\|false given\\.$#"
count: 2
path: ../tests/Composer/Test/Util/PerforceTest.php
-
message: "#^Parameter \\#2 \\$string of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringStartsWith\\(\\) expects string, string\\|false given\\.$#"
count: 2
@ -9014,21 +8598,6 @@ parameters:
count: 1
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Parameter \\#1 \\$filename of function file_get_contents expects string, string\\|false given\\.$#"
count: 2
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Parameter \\#1 \\$filename of function unlink expects string, string\\|false given\\.$#"
count: 3
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Parameter \\#1 \\$filename of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFileExists\\(\\) expects string, string\\|false given\\.$#"
count: 2
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Parameter \\#1 \\$object of method ReflectionProperty\\:\\:getValue\\(\\) expects object, object\\|string given\\.$#"
count: 1
@ -9054,11 +8623,6 @@ parameters:
count: 2
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Parameter \\#3 \\$fileName of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:copy\\(\\) expects string, string\\|false given\\.$#"
count: 3
path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php
-
message: "#^Implicit array creation is not allowed \\- variable \\$certificate does not exist\\.$#"
count: 2

View File

@ -137,7 +137,7 @@ class VersionGuesser
$isDetached = false;
// try to fetch current version from git branch
if (0 === $this->process->execute('git branch -a --no-color --no-abbrev -v', $output, $path)) {
if (0 === $this->process->execute(['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'], $output, $path)) {
$branches = array();
$isFeatureBranch = false;

View File

@ -62,7 +62,7 @@ class ProcessExecutor
/**
* runs a process on the commandline
*
* @param string $command the command to execute
* @param string|list<string> $command the command to execute
* @param mixed $output the output will be written into this var if passed by ref
* if a callable is passed it will be used as output handler
* @param ?string $cwd the working directory
@ -80,7 +80,7 @@ class ProcessExecutor
/**
* runs a process on the commandline in TTY mode
*
* @param string $command the command to execute
* @param string|list<string> $command the command to execute
* @param ?string $cwd the working directory
* @return int statuscode
*/
@ -94,7 +94,7 @@ class ProcessExecutor
}
/**
* @param string $command
* @param string|list<string> $command
* @param ?string $cwd
* @param bool $tty
* @param mixed $output
@ -107,7 +107,12 @@ class ProcessExecutor
$this->captureOutput = func_num_args() > 3;
$this->errorOutput = '';
if (is_string($command)) {
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
} else {
$process = new Process($command, $cwd, null, null, static::getTimeout());
}
if (!Platform::isWindows() && $tty) {
try {
$process->setTty(true);
@ -131,7 +136,7 @@ class ProcessExecutor
/**
* starts a process on the commandline in async mode
*
* @param string $command the command to execute
* @param string|list<string> $command the command to execute
* @param string $cwd the working directory
* @return PromiseInterface
*/
@ -222,7 +227,11 @@ class ProcessExecutor
$this->outputCommandRun($command, $cwd, true);
try {
if (is_string($command)) {
$process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout());
} else {
$process = new Process($command, $cwd, null, null, static::getTimeout());
}
} catch (\Throwable $e) {
call_user_func($job['reject'], $e);
@ -389,17 +398,15 @@ class ProcessExecutor
}
/**
* @param string $command
* @param ?string $cwd
* @param bool $async
* @return void
* @param string|list<string> $command
*/
private function outputCommandRun($command, $cwd, $async)
private function outputCommandRun($command, ?string $cwd, bool $async): void
{
if (null === $this->io || !$this->io->isDebug()) {
return;
}
$commandString = is_string($command) ? $command : implode(' ', array_map(self::class.'::escape', $command));
$safeCommand = Preg::replaceCallback('{://(?P<user>[^:/\s]+):(?P<password>[^@\s/]+)@}i', function ($m) {
// if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that
if (Preg::isMatch('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) {
@ -410,7 +417,7 @@ class ProcessExecutor
}
return '://'.$m['user'].':***@';
}, $command);
}, $commandString);
$safeCommand = Preg::replace("{--password (.*[^\\\\]\') }", '--password \'***\' ', $safeCommand);
$this->io->writeError('Executing'.($async ? ' async' : '').' command ('.($cwd ?: 'CWD').'): '.$safeCommand);
}

View File

@ -26,7 +26,7 @@ use React\Promise\Promise;
class ProcessExecutorMock extends ProcessExecutor
{
/**
* @var array<array{cmd: string, return: int, stdout: string, stderr: string, callback: callable|null}>|null
* @var array<array{cmd: string|list<string>, return: int, stdout: string, stderr: string, callback: callable|null}>|null
*/
private $expectations = null;
/**
@ -43,7 +43,7 @@ class ProcessExecutorMock extends ProcessExecutor
private $log = array();
/**
* @param array<string|array{cmd: string, return?: int, stdout?: string, stderr?: string, callback?: callable}> $expectations
* @param array<string|array{cmd: string|list<string>, return?: int, stdout?: string, stderr?: string, callback?: callable}> $expectations
* @param bool $strict set to true if you want to provide *all* expected commands, and not just a subset you are interested in testing
* @param array{return: int, stdout?: string, stderr?: string} $defaultHandler default command handler for undefined commands if not in strict mode
*
@ -51,11 +51,12 @@ class ProcessExecutorMock extends ProcessExecutor
*/
public function expects(array $expectations, $strict = false, array $defaultHandler = array('return' => 0, 'stdout' => '', 'stderr' => ''))
{
/** @var array{cmd: string|list<string>, return?: int, stdout?: string, stderr?: string, callback?: callable} $default */
$default = array('cmd' => '', 'return' => 0, 'stdout' => '', 'stderr' => '', 'callback' => null);
$this->expectations = array_map(function ($expect) use ($default) {
if (is_string($expect)) {
$expect = array('cmd' => $expect);
} elseif ($diff = array_diff_key(array_merge($default, $expect), $default)) {
} elseif (count($diff = array_diff_key(array_merge($default, $expect), $default)) > 0) {
throw new \UnexpectedValueException('Unexpected keys in process execution step: '.implode(', ', array_keys($diff)));
}
@ -74,7 +75,7 @@ class ProcessExecutorMock extends ProcessExecutor
if (count($this->expectations) > 0) {
$expectations = array_map(function ($expect) {
return $expect['cmd'];
return is_array($expect['cmd']) ? implode(' ', $expect['cmd']) : $expect['cmd'];
}, $this->expectations);
throw new AssertionFailedError(
'There are still '.count($this->expectations).' expected process calls which have not been consumed:'.PHP_EOL.
@ -106,7 +107,7 @@ class ProcessExecutorMock extends ProcessExecutor
}
/**
* @param string $command
* @param string|list<string> $command
* @param string $cwd
* @param bool $tty
* @param callable $output
@ -119,7 +120,8 @@ class ProcessExecutorMock extends ProcessExecutor
$callback = is_callable($output) ? $output : array($this, 'outputHandler');
$this->log[] = $command;
$commandString = is_array($command) ? implode(' ', $command) : $command;
$this->log[] = $commandString;
if (is_array($this->expectations) && count($this->expectations) > 0 && $command === $this->expectations[0]['cmd']) {
$expect = array_shift($this->expectations);
@ -135,8 +137,8 @@ class ProcessExecutorMock extends ProcessExecutor
$return = $this->defaultHandler['return'];
} else {
throw new AssertionFailedError(
'Received unexpected command "'.$command.'" in "'.$cwd.'"'.PHP_EOL.
(is_array($this->expectations) && count($this->expectations) > 0 ? 'Expected "'.$this->expectations[0]['cmd'].'" at this point.' : 'Expected no more calls at this point.').PHP_EOL.
'Received unexpected command '.var_export($command, true).' in "'.$cwd.'"'.PHP_EOL.
(is_array($this->expectations) && count($this->expectations) > 0 ? 'Expected '.var_export($this->expectations[0]['cmd'], true).' at this point.' : 'Expected no more calls at this point.').PHP_EOL.
'Received calls:'.PHP_EOL.implode(PHP_EOL, array_slice($this->log, 0, -1))
);
}

View File

@ -123,7 +123,7 @@ class RootPackageLoaderTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* latest-production 38137d2f6c70e775e137b2d8a7a7d3eaebf7c7e5 Commit message\n master 4f6ed96b0bc363d2aa4404c3412de1c011f67c66 Commit message\n",
),
'git rev-list master..latest-production',
@ -151,7 +151,7 @@ class RootPackageLoaderTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* latest-production 38137d2f6c70e775e137b2d8a7a7d3eaebf7c7e5 Commit message\n master 4f6ed96b0bc363d2aa4404c3412de1c011f67c66 Commit message\n",
),
), true);

View File

@ -35,7 +35,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array('cmd' => 'git branch -a --no-color --no-abbrev -v', 'return' => 128),
array('cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'], 'return' => 128),
array('cmd' => 'git describe --exact-match --tags', 'return' => 128),
array('cmd' => 'git log --pretty="%H" -n1 HEAD'.GitUtil::getNoShowSignatureFlag($process), 'return' => 128),
array('cmd' => 'hg branch', 'return' => 0, 'stdout' => $branch),
@ -63,7 +63,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* master $commitHash Commit message\n(no branch) $anotherCommitHash Commit message\n",
),
), true);
@ -88,7 +88,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
// Assumption here is that arbitrary would be the default branch
'stdout' => " arbitrary $commitHash Commit message\n* current $anotherCommitHash Another message\n",
),
@ -111,7 +111,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => " arbitrary $commitHash Commit message\n* feature $anotherCommitHash Another message\n",
),
array(
@ -139,7 +139,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => " latest-testing $commitHash Commit message\n* feature $anotherCommitHash Another message\n",
),
array(
@ -167,7 +167,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* latest-testing $commitHash Commit message\n current $anotherCommitHash Another message\n master $anotherCommitHash Another message\n",
),
), true);
@ -190,7 +190,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* (no branch) $commitHash Commit message\n",
),
'git describe --exact-match --tags',
@ -211,7 +211,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* (HEAD detached at FETCH_HEAD) $commitHash Commit message\n",
),
'git describe --exact-match --tags',
@ -232,7 +232,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* (HEAD detached at 03a15d220) $commitHash Commit message\n",
),
'git describe --exact-match --tags',
@ -251,7 +251,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* (HEAD detached at v2.0.5-alpha2) 433b98d4218c181bae01865901aac045585e8a1a Commit message\n",
),
array(
@ -273,7 +273,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* (HEAD detached at 1.0.0) c006f0c12bbbf197b5c071ffb1c0e9812bb14a4d Commit message\n",
),
array(
@ -296,7 +296,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* foo 03a15d220da53c52eddd5f32ffca64a7b3801bea Commit message\n",
),
), true);
@ -314,7 +314,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* 1.5 03a15d220da53c52eddd5f32ffca64a7b3801bea Commit message\n",
),
), true);
@ -333,7 +333,7 @@ class VersionGuesserTest extends TestCase
$process = $this->getProcessExecutorMock();
$process->expects(array(
array(
'cmd' => 'git branch -a --no-color --no-abbrev -v',
'cmd' => ['git', 'branch', '-a', '--no-color', '--no-abbrev', '-v'],
'stdout' => "* feature-branch 03a15d220da53c52eddd5f32ffca64a7b3801bea Commit message\n".
"remotes/origin/1.5 03a15d220da53c52eddd5f32ffca64a7b3801bea Commit message\n",
),