在 Windows 上安装 phpUnderControl 时的 PHPUnit 问题
在我的 Windows 7 机器上运行 phpUnderControl 时遇到问题,一直在网上搜索答案,但许多问题的文档非常糟糕...
(a.) Cruise Control 作为 Windows 服务安装,并启动和运行;运行
-->位置:C:\Program Files (x86)\CruiseControl
(b.) phpUnderControl 通过 Pear 安装
--> Pear 位置是 C:\wamp\bin\php\PEAR
(c.) 为 phpUnderControl
phpuc install "C:\Program Files (x86)\CruiseControl"
(d.) 配置 CruiseControl,现在当我尝试通过以下方式创建 phpUnderControl 示例时: phpuc 示例“C:\Program Files (x86)\CruiseControl”
我收到以下错误消息: 缺少 cli 工具 'phpunit',检查 PATH 变量
以下是我尝试解决此问题的方法:
(1.) 我包含了pear PHPUnit安装在Windows SYSTEM路径变量中。
-->没有帮助
(2.)我想也许 phpUnit 没有正确安装,所以我运行:
pear install -alldeps phpunit/PHPUnit
这给了我这个错误: Console_Getopt:无法识别的选项 -
我尝试重新安装 Console_Getopt 但它已正确安装并且是当前版本
有人可以帮助我吗?
我没有看到任何方法来指定 Console_Getopt 允许的选项,我什至不知道它正在运行哪个 php 脚本来将 --d 设置为允许的参数...
顺便说一句,当我使用 -n 运行 phpUnderControl 示例时标志(不支持 PHPUnit),它正在工作,因此 PHPUnit 有问题。
having problems here getting phpUnderControl running on my Windows 7 machine, been searching all over the net for answers but documentation to many of the problems is just really bad...
(a.) Cruise Control is installed as a Windows service and up & running
--> location: C:\Program Files (x86)\CruiseControl
(b.) phpUnderControl is installed via Pear
--> Pear location is C:\wamp\bin\php\PEAR
(c.) Configured CruiseControl for phpUnderControl
phpuc install "C:\Program Files (x86)\CruiseControl"
(d.) now when I try to create the phpUnderControl example via:
phpuc example "C:\Program Files (x86)\CruiseControl"
I get the following error message: Missing cli tool 'phpunit', check the PATH variable
Here's what I tried to solve this problem:
(1.) I included the path to the pear PHPUnit installation in the Windows SYSTEM path variable.
--> did not help
(2.) I thought maybe phpUnit was not properly installed, so I ran:
pear install -alldeps phpunit/PHPUnit
which gave me this error:
Console_Getopt: unrecognized option -- d
I tried to re-install Console_Getopt but it is correctly installed and the current version
Can anybody help me with this ?
I don't see any way to specify allowed options for Console_Getopt and I don't even know which php script it is running to set -- d as an allowed argument...
Btw, when I run the phpUnderControl example with the -n flag (no PHPUnit support), it is working, so there is a problem with PHPUnit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是对您评论的回应,但评论太长了。它没有回答你原来的问题。
一年前我们开始使用 phpUnderControl。最大的问题是它将文件合并到巡航控制中,这使得更新变得困难。我们必须为我们的设置修复很多样式表,这会使更新变得更糟。尽管仍然存在我们没有花时间修复的错误,但在过去的一年中,这种方法运行得很好。最烦人的是,当您单击摘要页面上的测试失败时,它不会将您带到所有测试的长列表中的正确失败。
不管怎样,我终于受够了,并要求有时间迁移到 Jenkins。幸运的是,Manuel Pichler(PHPMD、phpUnderControl)和 Sebastian Bergmann(PHPUnit)创建了 PHP 项目的 Jenkins 作业模板 。我能够使用来自 phpuc 的高度定制的 Ant 脚本,并通过 Jenkins 进行一些修改。
它运作得很好。最酷的部分是它跟踪构建到构建的详细结果,因此您可以看到测试何时开始失败以及持续了多长时间。这真的太棒了。 :)
This is in response to your comment, but it will be too long to put into a comment. It doesn't answer your original question.
We started with phpUnderControl a year ago. The biggest problem is that it merges files into Cruise Control which makes updating either difficult. And we had to fix a lot of the stylesheets for our setup which would make updating even worse. This worked well enough for the past year, though there were still bugs we didn't take time to fix. The most annoying is that when you clicked on a test failure on the summary page, it wouldn't take you to the correct failure on the long list of all tests.
Anyway, I finally had enough and pushed to be given the time to migrate to Jenkins. Luckily, Manuel Pichler (PHPMD, phpUnderControl) and Sebastian Bergmann (PHPUnit) had created Template for Jenkins Jobs for PHP Projects. I was able to use my highly customized Ant script from phpuc with a few modifications with Jenkins.
It works very well. The coolest part is that it tracks the detailed results from build to build, so you can see when a test started failing and for how long. It's just really awesome. :)
我相信你输错了命令。尝试:
I believe you mistyped the command. Try:
我解决了原来的问题:
我必须清除 pear 缓存,然后再次运行安装命令来重新安装 PHPUnit。
另外,设置一个名为 PHPBIN 的 Windows 环境变量 (--> /path/to/php) 或确保 pear 配置 PHP 设置正确...
--> 也很重要。 pear config-show
否则(某些)软件包将安装并将错误的 php bin 路径硬编码到 .bat 文件中,如果找不到 PHPBIN 变量,它将使用该变量...因此不起作用...
另一种方法解决这个问题的方法是正确配置 pear 设置,然后强制重新安装软件包,例如:
pear install -f --alldeps
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