Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
184 views
in Technique[技术] by (71.8m points)

php - Install phpunit on windows

How to install phpunit?

I read documentation https://github.com/sebastianbergmann/phpunit, but have an error:

>pear upgrade PEAR
Nothing to upgrade

>pear config-set auto_discover 1
config-set succeeded

>pear install pear.phpunit.de/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

How can I fix this error?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try the following instructions:

  1. In the command prompt, switch to the directory that you installed PHP to by running cd C:php
  2. Then install PEAR by running php go-pear.phar
  3. Press Enter to accept the default when it asks you “Are you installing a system-wide PEAR or a local copy?”
  4. Press Enter again to accept the file layout.
  5. Press Enter to finish.
  6. Run the following commands (they may take a while to update, be patient):
    • pear channel-update pear.php.net
    • pear upgrade-all
    • pear channel-discover pear.phpunit.de
    • pear channel-discover components.ez.no
    • pear channel-discover pear.symfony-project.com
    • pear update-channels
  7. Clear your pear cache pear clear-cache
  8. To install PHPUnit, run pear install --alldeps --force phpunit/PHPUnit
  9. To test that PHPUnit was successfully installed, run phpunit -v

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...