Skip to content

Commit

Permalink
CI - show phpunit version from custom binary, fix version on php7.4
Browse files Browse the repository at this point in the history
https://github.com/EdgedesignCZ/phpqa/runs/1844108206?check_suite_focus=true#step:6:40
`phpqa tools` shows phpunit 9.5.2 (loaded from composer.lock)
No version is displayed in html artifact for php7.4. But it works for php8.0.
- php8 - https://github.com/EdgedesignCZ/phpqa/runs/1844183851?check_suite_focus=true#step:6:27
- php7.4 - https://github.com/EdgedesignCZ/phpqa/runs/1844183845?check_suite_focus=true#step:6:27
   sh: 1: exec: "/home/runner/work/phpqa/phpqa/vendor/phpunit/phpunit/phpunit" --version: not found

Related to 148151c:
- PHP8 warning: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.
- https://github.com/symfony/process/blob/5.x/CHANGELOG.md#500
  • Loading branch information
zdenekdrahos committed Feb 6, 2021
1 parent 79b955d commit 379fcdb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Show versions
run: |
composer outdated --direct --all
./phpqa tools
./phpqa tools --config tests/.ci
- name: Run tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install:

test_script:
- cd C:\projects\phpqa
- php phpqa tools
- php phpqa tools --config tests/.appveyor
- php phpqa --verbose --report --config tests/.appveyor
- dir build

Expand Down
4 changes: 2 additions & 2 deletions src/Tools/GetVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ private function loadVersionFromConsoleCommand($command)

private function createSymfonyProcess($command)
{
if (!method_exists('Symfony\Component\Process\Process', 'setCommandLine')) {
return new Process([$command]);
if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {
return Process::fromShellCommandline($command);
} else {
return new Process($command);
}
Expand Down

0 comments on commit 379fcdb

Please # to comment.