哪个 PHP 单元测试框架:simpletest、phpunit 还是?

发布于 2024-07-08 12:27:33 字数 1451 浏览 10 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

悲念泪 2024-07-15 12:27:33

我认为两者都不会很快消失。 Simpletest 由一小群但参与其中的人维护。

PHPUnit 似乎拥有更大的用户群,这可以算作切换的一个论据。 不过我对 Simpletest 很满意。

I don't think either is going away anytime soon. Simpletest is maintained by a small, but involved group of people.

PHPUnit seems to have a bigger userbase, which may count as an argument for switching. I'm quite happy with Simpletest though.

晚雾 2024-07-15 12:27:33

我自己没有使用过SimpleTest,所以我不能说太多的比较。 但仅通过观察,PHPUnit 语法似乎更加冗长。

PHPUnit 手册 是一个很好的文档来源,涵盖了大部分领域框架的。 我对该手册的唯一抱怨是某些区域缺乏细节。

我使用 PHPUnit 而不是 SimpleTest 的主要原因是它具有出色的 Phing 集成。

I haven't used SimpleTest myself, so I can't say much in a way of comparison. Just by observation though, the PHPUnit syntax seems much more verbose.

The PHPUnit Manual is a great source of documentation, and covers most areas of the framework. My only complaint about the manual is that some areas lack detail.

My main reason for using PHPUnit over SimpleTest is that it has great Phing integration.

零崎曲识 2024-07-15 12:27:33

我刚刚回答了类似的问题并补充说有phpt。 phpt 还集成到 PHPUnit 中。

I just answered a similar question and added that there's phpt. phpt also integrates into PHPUnit.

诠释孤独 2024-07-15 12:27:33

我推荐 behat (+mink)
http://behat.org/

这是功能/集成测试,但它在更短的时间内涵盖了更多的代码。 PS

实际上,您可以使用它来编写单元/测试,但这有点矫枉过正......

I would recommend behat (+mink)
http://behat.org/

It's functional/integrational testing, but it covers much more code in much less time...

P.S. You can, actually, use it to write unit/tests, but it's a bit of overkill...

困倦 2024-07-15 12:27:33

我不知道您是否想切换本身,但我喜欢 phpt 来测试小型代码库或尽早进行测试(如果没有)需要测试的现有库。

phpt 的扩展性不如 Simpletest,但同样,它是适合正确工作的正确工具。 请参阅这篇文章进行深入讨论,让您快速入门向上。

I don't know if you'd want to switch per-se, but I like phpt for testing small libraries of code or getting tests out the door sooner rather than later, if there are none in an existing library that needs to be tested.

phpt won't scale as well as Simpletest, but again, the right tool for the right job. Take a look at this article for an in-depth discussion to get you ramped up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文