Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JillzTom's avatar

How can I add color to PhpStrom Terminal for PHPUnit

I'm testing my code using PHPUnit and I'm using PHPStorm's inbuilt terminal for it. How can I add colors to Terminal for PHPUnit.? In my phpunit.xml file, I've enabled the color option but still not getting any colors when running the test cases. But when I run gulp, I see colors. Anybody got any experience?

0 likes
1 reply
gbrock's avatar

I had this problem, but solved it by referencing the instance's copy of phpunit, so instead of running phpunit, run:

vendor/phpunit/phpunit/phpunit

...so I have an alias for that purpose (my personal shortcut is pu):

# in ~/.bash_profile
alias pu='vendor/phpunit/phpunit/phpunit'

...and make sure to run it from the project root. I'm unsure why I had to do this or even where I found that solution, but like I said, that made it work for me.

Please or to participate in this conversation.