codecept is not working, phpunit , Yii framework, PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gintare
    New Member
    • Mar 2007
    • 103

    codecept is not working, phpunit , Yii framework, PHP

    I am following instructions in file, which was created automatically when creating advanced demo yii application:
    „C:\Bitnami\wam pstack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced\test s\README.md“

    They say " 1. Install Codeception if it's not yet installed:"
    I run: c:\Bitnami\wamp stack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced>comp oser global require "codeceptio n/codeception=2.0 .*" "codeceptio n/specify=*" "codeceptio n/verify=*"

    They say "If you've never used Composer for global packages run `composer global status`."
    I run: c:\Bitnami\wamp stack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced>comp oser 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\wamp stack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced>cd c:\
    c:\>dir codecep* /s
    In my case this outputted directory „C:\Users\_user profilename_\Ap pData\Roaming\C omposer\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\_userp rofilename_\App Data\Roaming\Co mposer\vendor\b in
    contains codecept and phpunit.

    *********
    I have checked composer.json file in directory:
    Code:
    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:
    Code:
        "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\wamp stack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced>comp oser update
    It loaded and installed dozens of libraries including: "phpunit/phpunit":"4.5.* ", "codeceptio n/codeception:*", "codeceptio n/specify": "*", "codeceptio n/verify": "*"


    But command bin\codecept and bin\phpunit is not working from command line:
    c:\Bitnami\wamp stack-5.4.38-0\apache2\htdoc s\TamasCovacsYi i\advanced>bin\ codecept
    The system cannot find the path specified.

    If I check folder
    C:\Users\_userp rofilename_\App Data\Roaming\Co mposer\vendor\b in
    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\wamp stack-5.4.38-0\sym_prog\mypr oject>bin\phpun it
    PHPUnit 4.5.0 by Sebastian Bergmann and contributors... .

    About phpunit see:


    About codeception see:

    BDD style code blocks for PHPUnit / Codeception. Contribute to Codeception/Specify development by creating an account on GitHub.



    Why codecept and phpunit is not working from yii project folder? Where is my mistake?
    Last edited by zmbd; Apr 19 '15, 05:17 AM. Reason: [z{removed user name from paths, [CODE/] tagged the formatted text}]
Working...