Yii Framework Forum: phpunit, codecept commands - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

phpunit, codecept commands

#1 User is offline   gintare 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 28
  • Joined: 19-July 14

Posted 18 April 2015 - 03:48 AM

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\README.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\Gintare\AppData\Roaming\Composer\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:
c:\...\advanced>bin\codecept
c:\...\advanced>bin/codecept
c:\...\advanced>codecept


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

*********
I have checked composer.json file in directory:
C:\Bitnami\wampstack-5.4.38-0\apache2\htdocs\TamasCovacsYii\advanced. It had no phpunit and codeception
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
Thus i have added these lines to the file:
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*",
"phpunit/phpunit":"4.5.*",
"codeception/codeception:*",
"codeception/specify": "*",
"codeception/verify": "*"
},
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\codecept
The system cannot find the path specified.

If I check folder
C:\Users\Gintare\AppData\Roaming\Composer\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:
c:\Bitnami\wampstack-5.4.38-0\sym_prog\myproject>bin\phpunit
PHPUnit 4.5.0 by Sebastian Bergmann and contributors....

About phpunit see:
https://phpunit.de/m...lation.composer

About codeception see:
http://codeception.com/install
https://github.com/Codeception/Specify
https://packagist.or...ception/specify

Why codecept and phpunit is not working from yii project folder? Where is my mistake?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users