热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

有人知道PHP的RSPec吗?-AnyoneknowssomethinglikeRSPecforPHP?

RSPecisagreatrubytestframework(fortestdrivendevelopment),anyoneknowssomethinglikerspe

RSPec is a great ruby test framework (for test driven development), anyone knows something like rspec but, for PHP?

RSPec是一个很棒的ruby测试框架(用于测试驱动开发),任何人都知道RSPec之类的东西,但是对于PHP来说呢?

7 个解决方案

#1


3  

PHPUnit is the de-facto standard for UnitTesting in PHP.
It can do BD Testing to a limited extent:

PHPUnit是PHP中UnitTesting的实际标准。在一定程度上可以进行BD测试:

The PHPUnit_Extensions_Story_TestCase class adds a story framework that faciliates the definition of a Domain-Specific Language for Behaviour-Driven Development. Inside a scenario, given(), when(), and then() each represent a step. and() is the same kind as the previous step. The following methods are declared abstract in PHPUnit_Extensions_Story_TestCase and need to be implemented:

PHPUnit_Extensions_Story_TestCase类添加了一个故事框架,它为行为驱动的开发提供了特定于领域的语言的定义。在一个场景中,给定(),when(),然后()每个表示一个步骤。()与前面的步骤相同。PHPUnit_Extensions_Story_TestCase中声明了以下方法抽象,需要实现:

runGiven(&$world, $action, $arguments)
...

runWhen(&$world, $action, $arguments)
...

runThen(&$world, $action, $arguments)
...

Edit: An more sophisticated alternative might be Cucumber with Behat

编辑:一个更复杂的选择可能是与Behat合作

#2


16  

PHPSpec is a Behaviour-Driven Development framework for php. I've not used it myself yet, though, so I can't comment on it specifically.

PHPSpec是php的行为驱动开发框架。我还没有使用过它,所以我不能特别评论它。

#3


5  

Behat! Built on top of Symfony 2 components. Syntactically, not as nice as Ruby implementation but still get the benefits of BDD.

Behat !建立在Symfony 2组件之上。从语法上讲,它不如Ruby实现那么好,但仍然可以从BDD中获益。

I just stumbled upon it myself and haven't used it yet. From a glance, it looks like it's using closures (which it would need to do to work like RSpec/Cucumber) which is a PHP 5.3 addition.

我只是偶然发现它,还没有使用它。乍一看,它似乎在使用闭包(要像RSpec/Cucumber那样使用闭包),这是一个PHP 5.3的添加。

http://behat.org/

http://behat.org/

#4


2  

There are few of RSpec clones in PHP.

PHP中很少有RSpec克隆。

PHPSpec Spectrum

PHPSpec频谱

Also there is an original testing framework Codeception

还有一种原始的测试框架协同欺骗

#5


0  

If you are only intrested in the output of tests, you could use phpunit-progress which makes your tests results look exactly like RSpecs' results.

如果您只对测试的输出感兴趣,您可以使用phpunit-progress使您的测试结果与rspec的结果完全相同。

#6


0  

Bee is very similar, it is still very young, but i use it for some projects.

Bee是非常相似的,它仍然很年轻,但是我用它来做一些项目。

Hope this helps...

希望这有助于……

#7


-2  

Selenium is another one worth to mention here.

Selenium是另一个值得一提的东西。


推荐阅读
author-avatar
双子宝贝鱼
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有