我已经通过 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:\LocalWebServer\dch\c\my-wp-installtion.dch\wordpress-test\wordpress\wp-content\plugins\myplugin\phpunit.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:\LocalWebServer\dch\c\my-wp-installtion.dch\wordpress-test\wordpress\wp-content\plugins\myplugin\Tests\test_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
那么,我能以某种方式解决这个问题吗,因为输出不是很清楚,无法阅读。
亲切的问候