提问人:m_j 提问时间:6/20/2011 最后编辑:JasonMArcherm_j 更新时间:4/13/2015 访问量:1170
在 Windows 上安装 phpUnderControl 时的 PHPUnit 问题
PHPUnit Problems When Installing phpUnderControl On Windows
问:
在我的 Windows 7 机器上运行 phpUnderControl 时遇到问题,一直在网络上寻找答案,但许多问题的文档真的很糟糕......
(一)巡航控制作为 Windows 服务安装并启动并运行
-->位置:C:\Program Files (x86)\CruiseControl
(b.) phpUnderControl 通过 Pear 安装
-->梨的位置是 C:\wamp\bin\php\PEAR
(三)为 phpUnderControl 配置了 CruiseControl
phpuc 安装“C:\Program Files (x86)\CruiseControl”
(d.) 现在,当我尝试通过以下方式创建phpUnderControl示例时: phpuc 示例 “C:\Program Files (x86)\CruiseControl”
我收到以下错误消息:缺少 cli 工具“phpunit”,请检查 PATH 变量
这是我试图解决这个问题的方法:
(1.) 我在 Windows SYSTEM 路径变量中包含了 pear PHPUnit 安装的路径。
-->没有帮助
(2.) 我以为可能是phpUnit没有正确安装,所以我运行:
梨安装 -alldeps phpunit/PHPUnit
这给了我这个错误: Console_Getopt:无法识别的选项 -- d
我尝试重新安装Console_Getopt但它已正确安装并且当前版本
谁能帮我解决这个问题?
我看不出有任何方法可以为 Console_Getopt 指定允许的选项,我什至不知道它正在运行哪个 php 脚本来设置 - d 作为允许的参数......
顺便说一句,当我运行带有 -n 标志的 phpUnderControl 示例(不支持 PHPUnit)时,它正在工作,因此 PHPUnit 存在问题。
答:
这是对您的评论的回应,但放入评论中太长了。它没有回答你原来的问题。
一年前,我们开始使用phpUnderControl。最大的问题是它将文件合并到巡航控制中,这使得更新变得困难。而且我们不得不为我们的设置修复很多样式表,这将使更新变得更糟。在过去的一年里,这已经足够好了,尽管仍然有一些错误我们没有花时间去修复。最令人讨厌的是,当您在摘要页面上单击测试失败时,它不会将您带到所有测试的长列表中的正确失败。
不管怎样,我终于受够了,并迫切希望有时间迁移到 Jenkins。幸运的是,Manuel Pichler(PHPMD,phpUnderControl)和Sebastian Bergmann(PHPUnit)为PHP项目创建了Jenkins作业模板。我能够使用来自 phpuc 的高度定制的 Ant 脚本,并使用 Jenkins 进行一些修改。
它工作得很好。最酷的部分是它跟踪从一个构建到另一个构建的详细结果,因此您可以查看测试何时开始失败以及失败多长时间。这真是太棒了。:)
评论
I solved my original problem:
I had to clear my pear cache and then run the install command again to re-install PHPUnit.
Also, it is important to either set a Windows environment variable called PHPBIN (--> /path/to/php) or to make sure the pear configuration PHP settings are correct...
--> pear config-show
Otherwise (some) packages will install and HARDCODE an incorrect php bin path into the .bat file, and if it doesn't find the PHPBIN variable it will use that... and therefore not work...
Another way to deal with this is to configure pear settings correctly and then force re-install the package, e.g.:
pear install -f --alldeps
- M
I believe you mistyped the command. Try:
pear install --alldeps phpunit/PHPUnit
评论