Monday 15 March 2010

windows - Strange output from PHPUnit -


I have installed PHPUnit through peer, and I installed the WordPress Plugin Test () to test my WordPress plugin Has been under development.

The problem is that when the test runs normally, I am getting the following output:

  is running as a single site ... to run the multisite , Use - C multisite.xmlAjax test is not running ... To execute these, use the --group ajax by PHPEnit 3.7.21 by Sebastian Bergman. E: \ LocalWebServer \ dch \ c \ my-wp-installtion.dch \ wordpress-test \ wordpress \ wp-content \ plugins \ myplugin \ phpunit.xml [41; 37 mf [0 m [36; 1 ms [0 m time: 1 second, memory: 30.50 MB was 1 failure: 1) CDOAjax_Tests: test_tests failed to say incorrectly that is incorrect. E: \ LocalWebServer \ dch \ c \ my-wp-installtion.dch \ wordpress-test \ wordpress \ wp-content \ plugins \ myplugin \ test \ test_CDOAjax_tests.php: 7 [37; 41m [2 Caffeure! [0 m [37; 41m [2K Tests: 3, convulsions: 2, failures: 1, dropped: 1. [0m [2K]   

I do not know if it helps, but Phpunit.xml includes the following:

  & lt; Phpunit bootstrap = "bootstrap_tests.php" backupGlobal = "incorrect" color = "true" & gt; & Lt; Testsuites & gt; & Lt ;! - Default test suite for running all tests - & gt; & Lt; Testuite name = "cabdriver" & gt; & Lt; Directory prefix = "test_" suffix = ".php" & gt; Trial & lt; / Directory & gt; & Lt; / Testsuite & gt; & Lt; / Testsuites & gt; & Lt; / PHPUnit & gt;   

As you can see, there are some weird characters in PHPUnit output, such as the last line in which [0m [2k.

My system is a Windows 7 and

so I can fix that problem in any way, because the output is not so clear to read.

Kind of

This Unix console There are color codes for and they are hard coded in the framework framework, as you can see here:

Example: line 500 to 50 9

  Public function addError (PHPUnit_Framework_Test $ test, exception $ E, $ time) {if ($ this-> color) {$ this-> WriteProgress ("\ x1B [31; 1mE \ x1B [0m"]; } And {$ this- & gt; Write progress ('e'); } $ This- & gt; Final TestFailed = TRUE; }   

I believe that you can hide the attributes color = "false" settings in your phpunit.xml file:

  & Lt; Phpunit colors = "false" & gt; & Lt ;! - ... - & gt; & Lt; / PHPUnit & gt; You can read more here:   

No comments:

Post a Comment