问题
I have successfully installed PhpUnit in Xampp, now I need to configure it, i need to take this steps from the documentation:
2. Prepare the phpunit script:
1.
Rename the phpunit.php script to phpunit.
2.
Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).
3.
Copy it to a directory that is in your path and make it executable (chmod +x phpunit).
3. Prepare the PHPUnit/Util/PHP.php script:
1.
Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).
I can't find phpunit.php in the PEAR directory. Any clues on where is this file on a Xampp installation of PhpUnit? Any clues?
Best Regards,
Update1:
I have install it via PEAR. Ok, I will see if that work.
Best Regards,
回答1:
How did you install it ? If you use the pear installer that is shipped with Xampp it should just work.
/opt/lampp/bin/pear channel-discover pear.phpunit.de
/opt/lampp/bin/pear install phpunit/PHPUnit
and the executable should then reside in /opt/lampp/bin/phpunit.
If you installed it in another way (coping the files ?, sry i didn't find other hints in the xampp docs) then just point me to it and i will edit the answer
回答2:
I tried to make a summary of all necessary / useful commands to install phpunit. I hope this still might help some people, who stumble upon this.
Note that it is best, to run all commands as administrator.
php go-pear.phar
pear clear-cache
pear update-channels
pear upgrade --alldeps -f
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear channel-discover components.ez.no
pear config-set preferred_state beta
pear install --onlyreqdeps phpunit/PHPUnit
Good Luck, Sunny
来源:https://stackoverflow.com/questions/4625218/how-to-configure-phpunit-in-xampp