SimpleTest与PHPunit [英] SimpleTest vs PHPunit

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

问题描述

我想知道是否有人在这两个方面都有经验,可以揭示出两者之间的显着差异吗?

I was wondering if anyone that has experience in both this stuff can shed some light on the significant difference between the two if any?

每种产品都有什么特殊的强度使其适合于任何特定情况?

Any specific strength of each that makes it suitable for any specific case?

推荐答案

这个问题已经过时了,但由于它仍然在吸引访问量,因此我在这里再次说明了我的观点,因此我已经在其他一些问题上做了(较新的问题) )问题.

This question is quite dated but as it is still getting traffic and answers I though I state my point here again even so I already did it on some other (newer) questions.

我真的真的很困惑 ,因为SimpleTest still 被认为是phpunit的替代品.也许我只是被误导了,但据我所知:

I'm really really baffled that SimpleTest still is considered an alternative to phpunit. Maybe i'm just misinformed but as far as I've seen:

  • PHPUnit是标准;大多数框架都使用它(例如Zend Framework(1& 2),Cake,Agavi,甚至Symfony也在Symfony 2中放弃了用于phpunit的自己的Framework).
  • PHPUnit集成在每个PHP IDE(Eclipse,Netbeans,Zend Stuide,PHPStorm)中,并且运行良好.
  • Simpletest具有针对PHP 5.1(又称旧版本)的eclipse扩展,仅此而已.
  • PHPUnit可与所有连续集成服务器配合使用,因为它会输出所有标准日志文件以进行代码覆盖和测试报告.
  • 最简单的不是.尽管这不是一个大问题,但是一旦您停止仅仅测试"并开始开发软件,它就会占用您大量的时间(是的,这很具有争议性:)不要太在意它.)
  • PHPUnit会积极维护,稳定并且对每种代码库,每种方案以及您要编写测试的每种方式都适用.
  • (主观) PHPUnit提供了更好的代码覆盖率报告比Simpletest
  • 使用PHPUnit,您还可以在IDE中获得这些报告( Netbeans ,Eclipse等...)
  • 对于 web interface to phpunit tests ,也有一些建议.
  • PHPUnit is the standard; most frameworks use it (like Zend Framework (1&2), Cake, Agavi, even Symfony is dropping their own Framework in Symfony 2 for phpunit).
  • PHPUnit is integrated in every PHP IDE (Eclipse, Netbeans, Zend Stuide, PHPStorm) and works nicely.
  • Simpletest has an eclipse extension for PHP 5.1 (a.k.a. old) and nothing else.
  • PHPUnit works fine with every continuous integration server since it outputs all standard log files for code coverage and test reports.
  • Simpletest does not. While this is not a big problem to start with it will bite you big time once you stop "just testing" and start developing software (Yes that statement is provocative :) Don't take it too seriously).
  • PHPUnit is actively maintained, stable and works great for every codebase, every scenario and every way you want to write your tests.
  • (Subjective) PHPUnit provides much nicer code coverage reports than Simpletest
  • With PHPUnit you also get these reports inside your IDE (Netbeans, Eclipse, ...)
  • Also there are a couple of suggestings for a web interface to phpunit tests.

我还没有看到支持SimpleTest的任何论点.安装起来并不容易,因为可以通过pear获得PHPUnit:

I've yet to see any argument in favor of SimpleTest. It's not even simpler to install since PHPUnit is available via pear:

pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit

和首次测试"看起来几乎一样.

and the "first test" looks pretty much the same.

PHPUnit 3.7开始,只需使用或仅对于Windows 下载 phar并运行:

or for windows just downloading the phar and running:

php phpunit-.phar

或使用支持的作曲家安装方式喜欢

"require-dev": {
    "phpunit/phpunit": "3.7.*"
}

到您的composer.json.

to your composer.json.

对于要测试PHPUnit的所有内容,都有解决方案,您几乎可以在任何地方找到帮助(例如,freenode上的#phpunit irc频道,几乎每个php开发人员;))

For everything you want to test PHPUnit will have a solution and you will be able to find help pretty much anywhere (SO, #phpunit irc channel on freenode, pretty much every php developer ;) )

如果我说错了或忘记了一些,请纠正我:)

Please correct me if I've stated something wrong or forgot something :)

视频: http://conference.phpnw.org.uk/phpnw11 /schedule/sebastian-bergmann/

幻灯片: http://www.slideshare. net/sebastian_bergmann/the-php-testers-toolbox-osi-days-2011

它提到了诸如 Atoum 之类的东西,它称之为自我:一个简单,现代且直观的单元测试框架对于PHP!"

It mentions stuff like Atoum which calls its self: "A simple, modern and intuitive unit testing framework for PHP!"

我最初是在2011年1月写这个答案的,当时我与任何PHP测试项目都不隶属.从那时起,我成为PHPUnit的贡献者.

I've originally written this answer Jan. 2011 where I had no affiliation with any PHP Testing project. Since then I became a contributor to PHPUnit.

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

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