【问题标题】:Guard : phpunit is not installed on your machineGuard : phpunit 没有安装在你的机器上
【发布时间】:2014-01-15 23:07:17
【问题描述】:

我使用Guard 进行持续测试。

我的 Guardfile 是

guard :phpunit2, :all_on_start => false, :tests_path => 'app/tests/', :cli => '--colors -c phpunit.xml' do
    # Run any test in app/tests upon save.
    watch(%r{^.+Test\.php$})

    # When a view file is updated, run tests.
    # Tip: you probably only want to run your integration tests.
    watch(%r{app/views/.+\.php}) { Dir.glob('app/tests/**/*.php') }

    # When a file is edited, try to run its associated test.
    # Save app/models/User.php, and it will run app/tests/models/UserTest.php
    watch(%r{^app/(.+)/(.+)\.php$}) { |m| "app/tests/#{m[1]}/#{m[2]}Test.php"}
end

我从作曲家"phpunit/phpunit": "3.7.*"开始安装phpunit

但是当我使用警卫时:

ERROR - phpunit is not installed on your machine.

我使用 phpunit 的 CLI 是 vendor/bin/phpunit

所以,我尝试在 Guardfile 中添加 :command => "vendor/bin/phpunit" 到保护配置中

完整配置:

guard :phpunit2, :all_on_start => false, :tests_path => 'app/tests/', :command => "vendor/bin/phpunit", :cli => '--colors -c phpunit.xml' do

但是,我总是出错

ERROR - phpunit is not installed on your machine.

怎么做? 谢谢

【问题讨论】:

    标签: tdd laravel-4 phpunit guard


    【解决方案1】:

    你有没有:

    gem install guard-phpunit
    

    安装了吗?

    看看这个:https://github.com/Maher4Ever/guard-phpunit

    【讨论】:

    • 是的,我使用捆绑器:bundler.io 但是我不会使用 guar-phpunitguard-phpunit2 因为 phpunit2 最近更新了
    猜你喜欢
    • 2013-07-08
    • 2013-09-17
    • 2017-10-26
    • 2021-03-14
    • 2011-01-21
    • 2012-11-07
    • 2016-01-31
    • 2014-07-22
    • 1970-01-01
    相关资源
    最近更新 更多