Phing看不到PHPUnit [英] Phing can't see PHPUnit

查看:132
本文介绍了Phing看不到PHPUnit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个新的Continuous Integration服务器,该服务器利用Phing和PHPUnit来自动运行测试用例.

I'm trying to setup a new Continuous Integration server that utilizes Phing and PHPUnit for automatically running test cases.

我已经在Pear中安装了Phing:

I've installed Phing with Pear:

pear channel-discover pear.phing.info
pear install phing/phing

我已经使用新的PHAR方法安装了PHPUnit:

I've installed PHPUnit using the new PHAR method:

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit

然后我进入build.xml文件所在的目录,梯级phing,看来Phing不知道PHPUnit在哪里.

Then I go to the directory where my build.xml file is located, rung phing and it looks like Phing has no idea where PHPUnit is.

[jenkins@leroy workspace]$ phing
Buildfile: /home/jenkins/.jenkins/jobs/Framework/workspace/build.xml

Framework > test:

 [echo] Running Tests
Execution of target "test" failed for the following reason: /home/jenkins/.jenkins/jobs/Framework/workspace/build.xml:9:37: /home/jenkins/.jenkins/jobs/Framework/workspace/build.xml:9:37: PHPUnitTask requires PHPUnit to be installed

BUILD FAILED
/home/jenkins/.jenkins/jobs/Framework/workspace/build.xml:9:37:
/home/jenkins/.jenkins/jobs/Framework/workspace/build.xml:9:37: PHPUnitTask requires PHPUnit to be installed
Total time: 0.0764 seconds

[jenkins@leroy workspace]$

检查了Phing和PHPUnit的位置:

Checked the location of Phing and PHPUnit:

[jenkins@leroy workspace]$ which phing
/usr/bin/phing
[jenkins@leroy workspace]$ which phpunit
/usr/local/bin/phpunit

并且,确保PHP是足够新的:

And, making sure PHP is new enough:

[jenkins@leroy workspace]$ php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) 

我正在做所有这一切,因为我们正在用新服务器替换旧的Jenkins服务器.尝试使用最新的软件,但我不知道如何告诉Phing在哪里可以找到PHPUnit.

I'm doing all of this because we're replacing an older Jenkins server with this new one. Trying to use the newest software, but I can't figure out how to tell Phing where to find PHPUnit.

在此先感谢您的帮助!

大卫

推荐答案

似乎phing和PHPUnit的最新4.x版本存在一些实际问题:

It looks like there are some actual issues with phing and the latest 4.x versions of PHPUnit: http://www.phing.info/trac/ticket/1091.

因此,为解决此问题,我删除了PHPUnit 4并指定了较旧的版本:

So to fix the issue, I removed PHPUnit 4 and specified an older version:

pear install phpunit/PHPUnit-3.7.35

Phing和PHPUnit在这一点上立即起作用.

Phing and PHPUnit worked immediately at this point.

这篇关于Phing看不到PHPUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆