Apache 和 Nusphere PhpED 上的 PHPUnit 和 SimpleTest
我需要通过命令行以及图形调试器运行测试。图形调试器应该在 Apache 上运行代码。
我尝试了 SimpleTest,它在这两种情况下都运行良好,但 PHPUnit 只能在命令行上运行。我正在使用 NuSphere PhpED 进行调试,但无法使 phpunit 运行。
当我从编辑器运行 Simpletest 时,它作为 php 命令运行,但 PHPUnit 必须通过 $phpunit 命令运行。我无法理解这将如何运作。
Apache 上有一个 php 调试器模块,我可以使用 simpletest 单步执行代码。 PHPUnit 有调试器模块吗?
我的服务器是Linux,但我的编辑器是Windows。是否可以运行这样的测试?
是否也可以在不通过 PEAR 安装的情况下运行 PHPUnit,就像 Simpletest 一样 - 我们只是复制文件夹并包含自动运行文件。
我对这两种工具都很陌生,我需要决定使用哪一个并与 Hudson/Maven 集成。
请指导我,因为我对这些是新手。
谢谢 苏米特
I have a requirement that I need to run the tests through commandline as well as through a graphical debugger. The graphical debugger should run the code on Apache.
I tried SimpleTest and it works well as in both the cases but PHPUnit only works on commandline. I am using NuSphere PhpED to debug and I am not able to make phpunit to run.
When I run Simpletest from editor it runs as php command but PHPUnit will have to run through $phpunit command. I am not able to understand how will that work.
There is a php debugger module on Apache using which I can step through the code with simpletest. Is there any debugger module for PHPUnit?
My server is Linux but my editor is on windows. Is it possible to run tests like this?
Is it also possible to run PHPUnit without installing through PEAR and just like Simpletest - where we just copied the folder and included the autorun file.
I am new to both these tools and I need to decide which one to use and integrate with Hudson/Maven.
Please guide me as I am new to these.
Thanks
Sumit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一年多前,我们从 SimpleTest 迁移到 PHPUnit,并且非常高兴。 SimpleTest 被放弃,而 PHPUnit 正在积极开发,定期发布并制定未来计划。我们在 Ubuntu 和 Windows 计算机上通过命令行和 NetBeans IDE 运行 PHPUnit,即使我们的应用程序是在 Apache 后面运行的 CMS。
如需持续集成,请查看PHP 项目的 Jenkins 作业模板。它集成了用于测试的 PHPUnit 以及 PHPMD、PHPCPD, PHP 依赖, PHPLOC 和 PHP CodeSniffer。
我无法完全回答您关于在 Web 调试器中运行 PHPUnit 的原始问题。您可以使用 PEAR 安装 PHPUnit 并查看运行它的脚本。除了最初的 shell 脚本之外,全部都是 PHP,但只需做一些工作,您就可以用 PHP 编写一个类似的脚本来设置您的环境并调用适当的
TestRunner
。We migrated from SimpleTest to PHPUnit a little over a year ago and have been very happy. SimpleTest is abandoned while PHPUnit is actively developed with regular releases and a plan for the future. We run PHPUnit on Ubuntu and Windows machines both from the command line and in NetBeans IDE even though our application is a CMS running behind Apache.
For continuous integration, check out Templates for Jenkins Jobs for PHP Projects. It has integration of PHPUnit for testing as well as PHPMD, PHPCPD, PHP Depend, PHPLOC, and PHP CodeSniffer.
I can't completely answer your original question regarding running PHPUnit in a web debugger. You could install PHPUnit using PEAR and check out the script that runs it. It's all PHP except for the initial shell script, but with a little work you could write a similar script in PHP that sets up your environment and calls an appropriate
TestRunner
.