doukuo9116 2016-08-12 18:00 采纳率: 100%
浏览 145
已采纳

如何使用phpunit --testsuite选项?

How do I use the phpunit --testsuite command?

For example, I have a testfile:

test/xxx/RegistrationConfirmedListenerTest.php

If I run phpunit, then it will run the tests in RegistrationConfirmedListenerTest.php, but it also runs all other tests in my tests folder.

I have tried using this the --testsuite option like this:

phpunit --testsuite RegistrationConfirmedListenerTest

However, nothing runs.

PHPUnit 4.8.26 by Sebastian Bergmann and contributors.



Time: 46 ms, Memory: 4.00Mb

No tests executed!

I have read the docs here but there aren't any examples to help:

https://phpunit.de/manual/current/en/textui.html

  • 写回答

1条回答 默认 最新

  • dongyi9783 2016-08-12 18:05
    关注

    You have to create a phpunit.xml and define your testsuites there.

    <testsuites>
        <testsuite name="youttestsuitename1">
            <file>./path/to/folder/</file>
        </testsuite>
        <testsuite name="youttestsuitename1">
            <file>./path/to/folder2/</file>
        </testsuite>
    </testsuites> 
    

    More info to official documentations

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

报告相同问题?

悬赏问题

  • ¥15 matlab透明图叠加
  • ¥50 基于stm32l4系列 使用blunrg-ms的ble gatt 创建 hid 服务失败
  • ¥150 计算DC/DC变换器平均模型中的参数mu
  • ¥25 C语言代码,大家帮帮我
  • ¥15 请问以下文字内容及对应编码是用了什么加密算法或压缩算法呢?
  • ¥50 关于#html5#的问题:H5页面用户手机返回的时候跳转到指定页面例如(语言-javascript)
  • ¥15 无法使用此凭据登录,因为你的域不可用,如何解决?(标签-Windows)
  • ¥15 yolov9的训练时间
  • ¥15 在linux系统下vscode运行robocup3d上场球员报错
  • ¥15 Python语言实验