7

i installed PHPUnit by the book:

sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit

The include path is added in the /etc/php5/cli/php.ini

include_path = ".:/usr/share/php"

$ ls /usr/share/php/PHPUnit/
Extensions  Framework

But now, if I want to run the Tests for Zend Framework

user@server:/var/www/page/tests$ ./runtests.sh 
+ phpunit --verbose AllTests
./runtests.sh: line 72: phpunit: command not found
user@server:/var/www/page/tests$ php AllTests.php 
PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /var/www/page/tests/Zend/Acl/AclTest.php on line 37

Of course i also get a phpunit: command not foundwhen i try to follow the instructions in the PHPUnit Manual http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html outside of Zend Framework Context.

I'm getting the Feeling I'm missing something essential here ...

Solved

Looks like there was a Problem with the PEAR Channels, after adding the other 2 Again, it worked:

pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
6
  • Do you have path to the folder containing phpunit in you PATH variable? Commented Jan 26, 2011 at 11:57
  • @marcin could you please be a little bit more specific? Commented Jan 26, 2011 at 12:02
  • @Hannes. phpunit is a command that can be executed from your terminal. try setting it, i.e. export PATH=$PATH:/path/to/folder/with/phpunit Commented Jan 26, 2011 at 12:04
  • @Marcin I did export PATH=$PATH:/usr/share/php/PHPUnit nothing changed , but as you see above, in the Folger /usr/share/php/PHPUnit are only 2 sub direcotrys, nothing really to be executed Commented Jan 26, 2011 at 12:07
  • @Hannes. So maybe phpunit is in other folder or your phpunit was not fully installed if this command is missing. Commented Jan 26, 2011 at 12:09

1 Answer 1

6

Since the problem was solved in the comments I just make a real answer to sum up.

The reason for the problem was missing phpunit command. Reinstallation of phpunit and setting variable PATH to the folder containing phpunit command (export PATH=$PATH:/path/to/folder/with/phpunit) solved the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.