phpunit command doesn't work for laravel 4 on windows 7

前端 未结 11 1833
南笙
南笙 2020-12-15 06:06

I\'ve recently installed laravel and have written some tests in /tests directory but when I use phpunit at cmd in the same folder that phpunit.xml

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-15 06:35

    The phpunit executable is not in your project root folder, that's why it can't find it.

    Now I assume that you already have phpunit in your composer.json file, something like this:

    "require-dev": {
        "phpunit/phpunit": "3.7.*"
    }
    

    When installed by composer, the package will be installed to vendor/vendor_name/package_name. So to run it at your project root, type this command:

    vendor/phpunit/phpunit/phpunit
    

提交回复
热议问题