【问题标题】:Run test methode in phpunit Testsuite在 phpunit Testsuite 中运行测试方法
【发布时间】:2018-10-31 08:26:27
【问题描述】:

我想创建一个运行测试方法列表的测试套件。 我刚刚找到了一种运行整个文件的方法。 有没有办法只运行特定的方法? 像这样:

<phpunit bootstrap="src/autoload.php">
  <testsuites>
    <testsuite name="money">
      <file>tests/IntlFormatterTest.php::test1</file>
      <file>tests/IntlFormatterTest.php::test5</file>
      <file>tests/CurrencyTest.php::test7</file>
    </testsuite>
  </testsuites>
</phpunit>

【问题讨论】:

    标签: php phpunit test-suite


    【解决方案1】:

    使用 XML 配置文件进行配置是不可能(也不可取)的。

    您想要的是使用--filter 动态选择要执行的测试。

    【讨论】:

    • 您好,感谢您的快速回复。我使用 --filter=(test1234|test2334|test2337) 作为替代方案。这工作正常,但看起来不太好。但仍然可以根据需要工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-16
    • 2014-11-23
    • 2022-01-20
    • 2014-11-17
    • 2023-04-01
    • 2015-08-15
    相关资源
    最近更新 更多