424,301 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,301 IT Pros & Developers. It's quick & easy.

codecept is not working, phpunit , Yii framework, PHP

P: 103
I am following instructions in file, which was created automatically when creating advanced demo yii application:
„C:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced\tests\REA DME.md“

They say " 1. Install Codeception if it's not yet installed:"
I run: c:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced>composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"

They say "If you've never used Composer for global packages run `composer global status`."
I run: c:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced>composer global status

They say :Then add `<directory>/vendor/bin` to you `PATH` environment variable. Now you're able to use `codecept` from command line globally."

I found directory with codecept using:
c:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced>cd c:\
c:\>dir codecep* /s
In my case this outputted directory „C:\Users\_userprofilename_\AppData\Roaming\Compos er\vendor\bin“
which i added to System->Advanced System Settings → Environmental variables → PATH

But if i try codecept or bin\codecept command from command line, it is not recognised – the message is „The system cannot find the path specified.“ I have tried the following commands:

The phpunit or bin\phpunit is also not recognised as a command, athough it is on the path
C:\Users\_userprofilename_\AppData\Roaming\Compose r\vendor\bin
contains codecept and phpunit.

I have checked composer.json file in directory:
Expand|Select|Wrap|Line Numbers
  1. C:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced. It had no phpunit and codeception
  2.     "require-dev": {
  3.         "yiisoft/yii2-codeception": "*",
  4.         "yiisoft/yii2-debug": "*",
  5.         "yiisoft/yii2-gii": "*",
  6.         "yiisoft/yii2-faker": "*"
  7.     },
Thus i have added these lines to the file:
Expand|Select|Wrap|Line Numbers
  1.     "require-dev": {
  2.         "yiisoft/yii2-codeception": "*",
  3.         "yiisoft/yii2-debug": "*",
  4.         "yiisoft/yii2-gii": "*",
  5.         "yiisoft/yii2-faker": "*",
  6.         "phpunit/phpunit":"4.5.*",
  7.         "codeception/codeception:*",
  8.         "codeception/specify": "*",
  9.         "codeception/verify": "*"
  10.     },
and run from command line composer update:
c:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced>composer update
It loaded and installed dozens of libraries including: "phpunit/phpunit":"4.5.*", "codeception/codeception:*","codeception/specify": "*", "codeception/verify": "*"

But command bin\codecept and bin\phpunit is not working from command line:
c:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced>bin\codec ept
The system cannot find the path specified.

If I check folder
C:\Users\_userprofilename_\AppData\Roaming\Compose r\vendor\bin
I see four files, codecept, codecept.bat, phpunit, phpunit.bat

I also have symfony project with analogous composer.json file. If i change cmd to that project folder i can run phpunit:
PHPUnit 4.5.0 by Sebastian Bergmann and contributors....

About phpunit see:

About codeception see:

Why codecept and phpunit is not working from yii project folder? Where is my mistake?
Apr 18 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.