I am using PHPUnit in a Symfony2 project, installed through composer.
I need to override the command line argument handler, which is located in the PHPUnit_TextUI_Command
class from vendor/phpunit/phpunit/src/TextUI/Command.php
That looks easy:
- extend this class in a child class
- override the method
handleArguments(array $argv)
- use the child class instead of the original one in PHPUnit launcher
The problem lies in the last point. I cannot get PHPUnit to use another class than the original one when the CLI is launched, because it's hardcoded in the phpunit binary, which is installed by composer.
My two clues are:
- get the autoloader to use my child class instead of the original one, but that looks impossible because of name conflicts
- get composer to install another PHPUnit binary of my own
I'm stuck either way, any help would be very appreciated! Thank you.