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 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数
  • ¥15 关于#线性回归#的问题:【统计】回归系数要转化为相关系数才能进行Fisher' Z转化吗(相关搜索:回归模型)
  • ¥100 使用matlab解决含分段变量的优化问题
  • ¥15 matlab基于鲸鱼算法优化vmd
  • ¥20 PCB设计与制作问答
  • ¥20 课堂跑如何下载ppt
  • ¥15 STM32阿里云平台显示不了传感器采集的数据
  • ¥20 三菱FX系列PLC上位机串口下指令置位M64和M65,这两条指令分别是什么呢?
  • ¥15 有关结冰模拟程序咨询