doudg60800 2012-05-23 17:33
浏览 35
已采纳

Phpunit - 如何注释测试?

I'd like to run my tests in separate processes. Because of this, I would like to annotate my tests with "@runTestsInSeparateProcesses". However, I have never annotated Phpunit tests before and I haven't been able to find a good description of where to actually put the annotations. I've seen what the different annotations do, just not where to put them. Could someone please give me an example?

Thanks!

  • 写回答

1条回答 默认 最新

  • doushi1473 2012-05-23 17:40
    关注

    Annotations are applied to your test-case's docblock:

    /**
     * Short Description
     * 
     * @param string $input The test input
     * 
     * @return bool The result
     * 
     * @runTestsInSeparateProcesses
     */
    public function test_myMethod ($input) {
      // Test code here
    }
    

    Read more about DocBlocks: https://docs.phpdoc.org/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 【急】在线问答CNC雕刻机的电子电路与编程
  • ¥60 在mc68335芯片上移植ucos ii 的成功工程文件
  • ¥15 笔记本外接显示器正常,但是笔记本屏幕黑屏
  • ¥15 Python pandas
  • ¥15 蓝牙硬件,可以用哪几种方法控制手机点击和滑动
  • ¥15 生物医学数据分析。基础课程就v经常唱课程舅成牛逼
  • ¥15 云环境云开发云函数对接微信商户中的分账功能
  • ¥15 空间转录组CRAD遇到问题
  • ¥20 materialstudio计算氢键脚本问题
  • ¥15 有没有代做有偿主要做数据可视化部分即可(2023全国高考更省一本线理科类)