douguyi3903 2016-07-17 14:48
浏览 319
已采纳

vendor / bin / phpunit不适用于Lumen

I'm new to Lumen (and Laravel). I've created a project with Composer and now I'm trying to get PHPUnit to work.

I'm following a book, where it should be possible to run a default passing test by typing vendor/bin/phpunit in the terminal, but it gives the error:

'vendor' is not recognized as an internal or external command, operable program or batch file

I've checked that the phpunit file is actually there and that phpunit is added as dependency in my composer.json file. I've also tried ./vendor/bin/phpunit and vendor/bin/phpunit/phpunit, but with the same result.

I've searched Google to find a solution, but everyone else seem to have issues when running phpunit (wihout vendor/bin) and the solution is to use the full path vendor/bin/phpunit, but since I'm already doing that, it does not fix my problem.

I'm using PHPStorm on a Windows machine and running the PHP server via PHPStorm. I've not modified the default Lumen project.

Any help is greatly appreciated!

UPDATE:

Trying php vendor/bin/phpunit gives the following error:

You need to set up the project dependencies using the following commands:
wget http://getcomposer.org/composer.phar
php composer.phar install

I'm not sure what that means, since I've already installed Composer. I used Composer to create the project and I haven't changed the dependencies from the default.

  • 写回答

3条回答 默认 最新

  • dongzaobei0942 2016-07-17 19:17
    关注

    It turned out that some symlinks and permissions were not installed properly in the default project. I tried deleting the entire vendor/ directory and run composer install.

    Now I can run phpunit with the command vendor\bin\phpunit (because I'm running on Windows - thanks Nizarii)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分