codecamp

PHPUnit9.0 XML 配置文件-<testsuites> 元素

<testsuites> 元素

父元素:​<phpunit>

此元素是一个或多个 ​<testsuite>​ 元素的根元素,用于配置需要执行的测试。

<testsuite> 元素

父元素:​<testsuites>

<testsuite>​ 元素必须拥有 ​name属性,可以有一个或多个 ​<directory>​ 及 ​<file>​ 子元素,分别代表需要搜索测试的目录及元素。

<testsuites>
  <testsuite name="unit">
    <directory>tests/unit</directory>
  </testsuite>

  <testsuite name="integration">
    <directory>tests/integration</directory>
  </testsuite>

  <testsuite name="edge-to-edge">
    <directory>tests/edge-to-edge</directory>
  </testsuite>
</testsuites>

可以用 ​phpVersion​和 ​phpVersionOperator属性来指定 PHP 版本需求:

<testsuites>
  <testsuite name="unit">
    <directory phpVersion="8.0.0" phpVersionOperator=">=">tests/unit</directory>
  </testsuite>
</testsuites>

在上面的示例中,仅当 PHP 版本至少为 8.0.0 时,才会将 ​tests/unit​ 目录中的测试添加到测试套件中。​phpVersionOperator​属性是可选的,默认为 ​>=​。


PHPUnit9.0 XML 配置文件-<phpunit> 元素
PHPUnit9.0 XML 配置文件-<coverage> 元素
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }