diff --git a/bin/composer_install.sh b/bin/composer_install.sh index fbbd39c..41e84f5 100755 --- a/bin/composer_install.sh +++ b/bin/composer_install.sh @@ -28,5 +28,6 @@ if [ -n "${working_directory}" ]; then composer_options+=("--working-dir" "${working_directory}") fi -echo "::debug::Using the following Composer command: 'composer ${composer_command} ${composer_options[*]}'" -"${php_path}" "${composer_path}" "${composer_command}" "${composer_options[@]}" +full_command="${composer_path} ${composer_command} ${composer_options[*]}" +echo "::debug::Using the following Composer command: '${full_command}'" +$full_command diff --git a/tests/expect/composer_install_18.exp b/tests/expect/composer_install_18.exp new file mode 100755 index 0000000..b862436 --- /dev/null +++ b/tests/expect/composer_install_18.exp @@ -0,0 +1,13 @@ +#!/usr/bin/env -S expect -f + +set timeout 3 +spawn ../../bin/composer_install.sh "" "" "" "" "../fixtures/composer.phar" "composer.lock" +match_max 100000 + +expect "::debug::Using the following Composer command: '../fixtures/composer.phar install --no-interaction --no-progress --ansi'" +expect "Installing dependencies" +expect "Generating autoload files" +expect eof + +# Clean up +file delete -force vendor diff --git a/tests/expect/composer_install_19.exp b/tests/expect/composer_install_19.exp new file mode 100755 index 0000000..ca326de --- /dev/null +++ b/tests/expect/composer_install_19.exp @@ -0,0 +1,15 @@ +#!/usr/bin/env -S expect -f + +set timeout 3 +spawn ../../bin/composer_install.sh "" "" "../fixtures/no-lock-file" "" "" "" +match_max 100000 + +expect "::debug::Using the following Composer command: '*/composer update --no-interaction --no-progress --ansi --working-dir ../fixtures/no-lock-file'" +expect "Updating dependencies" +expect "Writing lock file" +expect "Generating autoload files" +expect eof + +# Clean up +file delete -force ../fixtures/no-lock-file/vendor +file delete -force ../fixtures/no-lock-file/composer.lock diff --git a/tests/expect/composer_paths_09.exp b/tests/expect/composer_paths_09.exp new file mode 100755 index 0000000..953b5a0 --- /dev/null +++ b/tests/expect/composer_paths_09.exp @@ -0,0 +1,17 @@ +#!/usr/bin/env -S expect -f + +set timeout 3 +spawn ../../bin/composer_paths.sh "../fixtures/composer.phar" +match_max 100000 + +expect "::debug::Composer path is '../fixtures/composer.phar'\r +::debug::Composer version 2.2.2 2021-12-29 14:15:27\r +::debug::Composer cache directory found at '*'\r +::debug::File composer.json found at './composer.json'\r +::debug::File composer.lock path computed as './composer.lock'\r +::set-output name=command::../fixtures/composer.phar\r +::set-output name=cache-dir::*\r +::set-output name=json::./composer.json\r +::set-output name=lock::./composer.lock\r +" +expect eof diff --git a/tests/fixtures/composer.phar b/tests/fixtures/composer.phar new file mode 100755 index 0000000..6c9a92d Binary files /dev/null and b/tests/fixtures/composer.phar differ