I just installed phpunit.phar and am trying to set it up. What I am trying to do is to put phpunit.phar in a path so that I can run it from anywhere directly from the php cli. At this point, it is in my include_path and I can include it within a script from anywhere. But, what I think I need to do is run it from the cli "php phpunit.phar".
Is this doable or is it even appropriate?
Assuming the PHAR extension is enabled, all PHAR files may be executed simply by executing them with the PHP interpreter (" php file. phar "). If the PHAR extension is not enabled, only PHAR format can be executed.
I think that the phpunit.phar just need to be in your path variable. Or write a small script which is located in /usr/bin with this content:
#!/bin/sh
php /path/to/phpunit.phar
if you are using windows
%~dp0php.exe %~dp0pharcommand.phar %*
Now you can run on cmd prompt
phpunit --v
This is no longer necesssary, according to http://phpunit.de/getting-started.html. You can simply rename phpunit.phar to phpunit, chmod it executable, and put it in your path (usually /usr/local/bin) and it should automatically detect the interpreter directive.
You can run it from everywhere. Just give the correct path:
/usr/share/pear/exec/phpunit.phar -c app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With