dongshan6870 2011-06-28 18:29
浏览 72
已采纳

如何在PHP中执行集成测试?

I am currently performing unit tests on my code (using PHPUnit and Jenkins) but I have read a lot about integration testing.

  • Are there any tools to perform this in php (preferably automated)?

  • How would I go about implementing it? Are there any good tutorials anywhere?

  • 写回答

2条回答 默认 最新

  • douhu8851 2011-06-28 18:47
    关注

    Basically the way to go is to implement besides unit tests also mock tests which are not solely testing a single unit more like a group of units bunched together and you see them as a logical unit which should behave in a certain way while handing in some input or calling methods.

    One possible library for this is yaymock in the google code repository. Its a php5 mock library.

    Further integration tests are more or less only tests which test the complete system behavior. The basic thing is setting a test environment up and deploy your application afterwards. You can do this kind of testing also with a unit test framework or a mock library. As you wish. Integration tests in detail in your case are http requests, based on some data in your database and an expected possible "html" output.

    To automate this you can use some continous integration frameworks... either Hudson, Arbit or phpUnderControl. For setting up php with hudson and some nice testing plugins there is a pretty good tutorial. It mentions also some useful plugins like Code-Coverage checks, etc ... which could be integrated inside the environment.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程