可能重复:
简单测试与 PHPunit
我是软件开发良好实践的新手。我需要知道我应该使用女巫测试单元框架。我看到有些人使用 PHPUnit,有些人使用 SimpleTest。我应该为初学者选择什么套餐?
此致,
可能重复:
简单测试与 PHPunit
我是软件开发良好实践的新手。我需要知道我应该使用女巫测试单元框架。我看到有些人使用 PHPUnit,有些人使用 SimpleTest。我应该为初学者选择什么套餐?
此致,
我真的很困惑 Simpletest 仍然被认为是 phpunit 的替代品。也许我只是被误导了,但据我所知:
我还没有看到任何支持 Simpletest 的论据。由于 PHPUnit 可通过 pear 获得,因此安装起来并不简单:
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
和“第一次测试”看起来几乎一样。
对于您想要测试的所有内容,PHPUnit 都会有一个解决方案,并且您几乎可以在任何地方找到帮助(SO,freenode 上的#phpunit irc 频道,几乎每个 php 开发人员;))
如果我说错了什么或忘记了什么,请纠正我:)
I started with SimpleTest because the learning curve didn't seem as steep. But it's not maintained, and brings up loads of warnings in PHP5.3, as well as not being able to do everything I wanted. I eventually had to switch to PHPUnit, which was a long process converting my tests. If only I'd started with PHPUnit in the first place!
SimpleTest is slightly easier to grasp, but PHPUnit is the best ( in my opinion at least ) , so if you want to start learning and using a framework, start with the one you're going to use when you'll be a master in TDD. Don't look at if it's easier or harder now , because if you start with SimpleTest for example , then you start using Zend Framework because your boss tells you so , you'll have to use PHPUnit with ZF. So think of your future , because an easy to learn framework doesn't necessarily have to be the best one , usualy the harder to grasp the better the framework .
Also have a look at their revisions , see which one is maintained better .
我发现 SimpleTest 易于启动,并且可用于我的目的。目前没有发现大问题。手册/网站有点混乱,但是通过一些示例搜索就足够了。
感觉不是很专业,但是当你要求初学者框架时,一定要试试那个:)
这是一个很好的阅读...这使用 SimpleTest 并且开始它比 PHPUnit 更好...