问题
I am trying to learn PHPUnit. I use MacOS X and just installed PHPUnit using PEAR by doing this:
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
After installation, it's located in pear/share/pear/PHPUnit
. It has Extensions
and Framework
folders.
I tried creating the examples from the Pear PHPUnit tutorial, but in the example it says it requires PHPUnit.php
and I don't see that file. Do I need to install anything else to make this work?
Also, where should the example scripts be placed?
Can anyone please guide me in setting up this PHPunit test and try it with one example? Thanks.
回答1:
The docs located at the pear.phpunit.de channel are completely out of date. Please do not use them anymore. Quoting Sebastian Bergmann, author of PHPUnit:
Whoever is responsible for the PEAR Manual: please remove http://bit.ly/gU8eEG as it confuses people (and search engines).
The official docs are located at:
- http://www.phpunit.de/manual/3.5/en/index.html
To install PHPUnit, follow the instructions at the official phpunit website instead:
- https://github.com/sebastianbergmann/phpunit/
e.g. do
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
and then
pear install --alldeps --force phpunit/PHPUnit
来源:https://stackoverflow.com/questions/5733309/installing-phpunit-and-examples