在phpunit Testsuite中运行测试方法

时间:2018-05-21 16:24:20

标签: php phpunit test-suite

我想创建一个testuite,它将运行一系列测试方法。 我刚刚找到了运行整个文件的方法。 有没有办法运行特定的方法? 像这样:

<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>

1 个答案:

答案 0 :(得分:2)

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

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

相关问题