Chinaunix首页 | 论坛 | 博客
  • 博客访问: 510738
  • 博文数量: 130
  • 博客积分: 10060
  • 博客等级: 上将
  • 技术积分: 1720
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-21 12:35
文章分类

全部博文(130)

文章存档

2011年(2)

2010年(9)

2009年(41)

2008年(78)

我的朋友

分类:

2008-04-08 11:40:44

附录 A XML配置文件

...

测试套件

...



/path/to/*Test.php files
/path/to/MyTest.php

分组

...




name


name


上面的XML配置对应带下面的参数调用TextUI测试启动器:

  • --group name

  • --exclude-group name

包含及排除用于代码覆盖率的文件

...




/path/to/files
/path/to/file

/path/to/files
/path/to/file



/path/to/files
/path/to/file

/path/to/files
/path/to/file



上面的XML配置对应如下使用类PHPUnit_Util_Filter

PHPUnit_Util_Filter::addDirectoryToFilter(
/path/to/files', '.php'
);

PHPUnit_Util_Filter::addFileToFilter('/path/to/file');

PHPUnit_Util_Filter::removeDirectoryFromFilter(
/path/to/files', '.php'
);

PHPUnit_Util_Filter::removeFileFromFilter('/path/to/file');

PHPUnit_Util_Filter::addDirectoryToWhitelist(
/path/to/files', '.php'
);

PHPUnit_Util_Filter::addFileToWhitelist('/path/to/file');

PHPUnit_Util_Filter::removeDirectoryFromWhitelist(
/path/to/files', '.php'
);

PHPUnit_Util_Filter::removeFileFromWhitelist('/path/to/file');

日志

...



yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>











上面的XML配置对应带下面的参数调用TextUI测试启动器:

  • --coverage-html /tmp/report

  • --coverage-xml /tmp/coverage.xml

  • --log-graphviz /tmp/logfile.dot

  • --log-json /tmp/logfile.json

  • --log-metrics /tmp/metrics.xml

  • > /tmp/logfile.txt

  • --log-pmd /tmp/pmd.xml

  • --log-tap /tmp/logfile.tap

  • --log-xml /tmp/logfile.xml

  • --testdox-html /tmp/testdox.html

  • --testdox-text /tmp/testdox.txt

PMD规则

...




threshold="5,30"/>
threshold="6"/>
threshold="20"/>
threshold="1000"/>
threshold="45"/>
threshold="15"/>
threshold="35,70"/>
threshold="30"/>
threshold="20"/>
threshold="100"/>
threshold="10"/>
threshold="200"/>


上面的对应内建的PMD规则的默认设置。

设置PHP INI和全局变量

...






上面的XML配置对应下面的PHP代码:

ini_set('foo', 'bar');
$GLOBALS['foo'] = 'bar';
阅读(1441) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~