Search code examples
composer-phpcodeception

Run codeception on Windows system creates an Error when done like shown in the Quickstart


Running this: C:\Projects\HelloWorld>php vendor\bin\codecept generate:cest acceptance createTodo

Results in the Error:


if [ -d /proc/cygdrive ]; then
    case $(which php) in
        $(readlink -n /proc/cygdrive)/*)
            # We are in Cygwin using Windows php, so the path must be translated
            dir=$(cygpath -m "$dir");
            ;;
    esac
fi

"${dir}/codecept" "$@"

I just found the answer at the bottom of some git commentsection and wanted to make it more accessible. https://github.com/Codeception/Codeception/issues/3281 thx test1git1


Solution

  • The fix to run it on windows is to run the .bat file to do all the commands and drop the "php" at the start.

    vendor\bin\codecept.bat generate:cest acceptance createTodo