Codeception: Bootstrap doesn't seem to work (Win7, PHP 7 x64)

Created on 27 Jun 2016  路  10Comments  路  Source: Codeception/Codeception

All I'm getting in my command line when I try and run php vendor/bin/codecept bootstrap is the below text:

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../codeception/codeception" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/codecept" "$@"

I'm running PHP.net's thread-safe 64-bit PHP 7 for Windows, so no cygwin or anything. PHP is in my path and php --version works.

If I try codecept.bat bootstrap, I get the following:

@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../codeception/codeception/codecept
php "%BIN_TARGET%" %*

Can anyone give some guidance? What I know about bash scripting would fit on the head of a pin :(
Thanks!

Most helpful comment

Just use the bat file on windows with backslashes as directory separator and you will be fine:

Run:
vendor\bin\codecept.bat bootstrap

All 10 comments

@Muzical84 Could you let us know how did you solve this issue?

@Muzical84 @Naktibalda
Hi, guys! Have you found solution for this problem?
I am trying to run codeception on Windows. ( virtualbox + vagrant ).
Thanks in advance if you have something to say.

Same here ,

how did you manage to fix it please ?

Try using lower version of PHP. It looks like, this is the reproducable issue with PHP 7.

http://mayurshah.in/1519/getting-error-message-vendor-codecept-generate-acceptance

No need to use php loader. go to "bin/" and type "codecept bootstrap", but then folder "tests" will be created in "bin"

Just use the bat file on windows with backslashes as directory separator and you will be fine:

Run:
vendor\bin\codecept.bat bootstrap

Hi, I had the same problem. In my case delete php from the begining of the command, and it works. So my command look like
bin\codecept.bat bootstrap --empty

@linslin also it's works and with simple slashes: vendor/bin/codecept.bat run

oh ,thx guys, the official quick start is really bad

This worked for me:

vendor\\bin\\codecept.bat bootstrap

Was this page helpful?
0 / 5 - 0 ratings