windows – PHPUnit的奇怪输出
发布时间:2020-12-13 22:27:07 所属栏目:Windows 来源:网络整理
导读:我已经通过PEAR安装了 PHPUnit,并且我已经安装了WordPress插件测试( https://github.com/tierra/wordpress-plugin-tests)来测试正在开发的WordPress插件. 测试运行正常的问题,我得到以下输出: Running as single site... To run multisite,use -c multisite
我已经通过PEAR安装了
PHPUnit,并且我已经安装了WordPress插件测试(
https://github.com/tierra/wordpress-plugin-tests)来测试正在开发的WordPress插件.
测试运行正常的问题,我得到以下输出: Running as single site... To run multisite,use -c multisite.xml Not running ajax tests... To execute these,use --group ajax. PHPUnit 3.7.21 by Sebastian Bergmann. Configuration read from E:LocalWebServerdchcmy-wp-installtion.dchwordpress-testwordpresswp-contentpluginsmypluginphpunit.xml [41;37mF[0m.[36;1mS[0m Time : 1 second,Memory: 30.50Mb There was 1 failure: 1) CDOAjax_Tests::test_tests Failed asserting that false is true. E:LocalWebServerdchcmy-wp-installtion.dchwordpress-testwordpresswp-contentpluginsmypluginTeststest_CDOAjax_tests.php:7 [37;41m[2KFAILURES! [0m[37;41m[2KTests: 3,Assertions: 2,Failures: 1,Skipped: 1. [0m[2K 我不知道这是否有帮助,但phpunit.xml包含以下内容: <phpunit bootstrap="bootstrap_tests.php" backupGlobals="false" colors="true" > <testsuites> <!-- Default test suite to run all tests --> <testsuite name="cabdriver"> <directory prefix="test_" suffix=".php">tests</directory> </testsuite> </testsuites> </phpunit> 正如您所看到的,PHPUnit输出有一些奇怪的字符,比如包含[0m [2k]的最后一行. 我的系统是Windows 7,我运行XAMPP,并通过PEAR安装了PHPUnit 那么,我能以某种方式解决这个问题,因为输出不是那么清楚. 亲切的问候 解决方法
这些是unix控制台的颜色代码,它们在phpunit框架中进行了硬编码,如下所示:
https://github.com/sebastianbergmann/phpunit/blob/master/PHPUnit/TextUI/ResultPrinter.php
示例:行500到509. public function addError(PHPUnit_Framework_Test $test,Exception $e,$time) { if ($this->colors) { $this->writeProgress("x1b[31;1mEx1b[0m"); } else { $this->writeProgress('E'); } $this->lastTestFailed = TRUE; } 我相信你可以在phpunit.xml文件中隐藏设置属性colors =“false”的颜色: <phpunit colors="false"> <!-- ... --> </phpunit> 你可以在这里阅读更多:http://phpunit.de/manual/3.7/en/appendixes.configuration.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
推荐文章
站长推荐
- windows – SwitchToThisWindow将当前窗口发送到
- .net – NAnt和双平台构建 – 在Windows和Mono /
- 如何在Windows上为ruby安装PCAP
- 窗口 – 允许在资源管理器样式的列表视图中选择从
- windows-server-2008 – Windows Server 2008 R2
- windows-server-2008-r2 – 应用共享权限删除本地
- entity-framework – 我可以在Windows Phone 8上
- windows – 在CMD中重命名文件日期的文件
- windows-server-2008 – 默认域策略已损坏
- Windows / Linux socat通过IP共享串行设备
热点阅读