installing phpunit and examples

陌路散爱 提交于 2019-12-11 23:38:53

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!