您为 Symfony 使用哪个单元测试框架? [英] Which unit testing framework do you use for Symfony?

查看:18
本文介绍了您为 Symfony 使用哪个单元测试框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您为 Symfony 使用哪个单元测试框架?

Which unit testing framework do you use for Symfony?

Lime 还是 PHPUnit?使用它们的优缺点是什么?

Lime or PHPUnit? What are the pros and cons of using them?

推荐答案

在我看来,我想到了以下几点:

In my opinion, here are a few things that come to my mind :

  • PHPUnit 与其他工具的集成度更高,例如,
    • PHPUnit is more integrated with other tools, like, for instance,
      • Selenium (PHPUnit can use it to open true real browsers to test your site)
      • phpUnderControl for continuous-integration

      但请注意,我不使用 symfony,也不使用石灰...
      不过,除了那些使用 symfony 的人之外,我从未听过任何人谈论它——这不是一件好事,因为有一天你将不得不使用另一个框架(是的,这会发生 ^^)

      But note I don't work with symfony, nor lime...
      Still, I've never heards anyone speak about it, except for those working with symfony -- that not a good thing, for the day you'll have to work with another framework (yes, this happens ^^ )


      PHPUnit 中没有的一件事:


      One thing that's not in PHPUnit :

      • 假"浏览器(能够向应用程序发出 HTTP 请求,无需使用 Selenium 打开真正的浏览器)

      但有些框架(Zend Framework 确实如此,它的 Zend_Test 组件) 与 PHPUnit 集成(或使用它),同时允许将数据注入 MVC 并获取响应,而无需发出任何 HTTP 请求.
      我不知道 symfony 是否允许这样做,但对于 ZF/PHPUnit 来说这是一件好事 ^^

      But some frameworks (Zend Framework does, with it's Zend_Test component) integrate with PHPUnit (or use it), while allowing injection of data into the MVC and fetching of the response, without having to issue any HTTP Request.
      I don't know if symfony allows that, but that's a nice thing with ZF/PHPUnit ^^


      (是的,不是特定于 symfony 的答案;但我所说的内容必须仍然适用于该框架)

      这篇关于您为 Symfony 使用哪个单元测试框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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