phpunit command line not working correctly

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
parka
Forum Commoner
Posts: 52
Joined: Mon Feb 26, 2007 6:48 am

phpunit command line not working correctly

Post by parka »

Wow, I've actually a series of phpunit problems so bear with me. I'm using Mac OS 10.5.5, PHP 5.2.6.

--------------------------------------------------------------------------------------------
-------------------- Situation 1 -----------------------
--------------------------------------------------------------------------------------------

I tried installing PHPUnit manually by downloading and unarchiving. My PEAR packages are in
\usr\local\bin\PEAR
I've followed the installation guide from phpunit.de and modified the path to the command line to "/usr/bin/php". Then I put the phpunit file into "/usr/bin"

When I type "phpunit ArrayTest.php" in the terminal, it prints back the phpunit help commands.
By the way, how does phpunit finds the file to test anyway? I know they look at the filename but which directory do they look in?

--------------------------------------------------------------------------------------------
-------------------- Situation 2 -----------------------
--------------------------------------------------------------------------------------------

I've decided to try PEAR installation, again. I didn't delete the phpunit bash file from "\usr\bin" though.

I removed the PHPUnit installation earlier manually first.

The strange thing is, when I "pear list", the PHPUnit packages are not listed. I've one old version 1.3.2.
But I know they are there. So I uninstall the 1.3.2 version with "pear uninstall".

Next, I installed back with
pear install phpunit/PHPUnit
Installation was ok. But when I "pear list", PHPUnit package was not shown.

That's where I stopped and typed this entry.

Is it possible to skip all these and test manually, with PHPUnit, via the web browser? My php files have no problem locating PHPUnit files. That's the easiest way out, I guess.
nfrandsen
Forum Newbie
Posts: 6
Joined: Fri Nov 21, 2008 4:42 am

Re: phpunit command line not working correctly

Post by nfrandsen »

please someone respond, i having the very same problem?! i think..
when i try test a file in the command line with phpunit it simply displays, "phpunit command not found"!?
I have installed it using the pear installer and it seemed to install fine...
why is it not being registered as a command line action? I have an old installation of php using marks entropy binary packages, and now instead using xampp which is situated in /Applications folder, is this to blame?
Thank you for your help..
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: phpunit command line not working correctly

Post by Jenk »

I'm not able to help specifically with your issue, but "/usr/local/bin/PEAR" seems like an.. odd place to keep your library files? I'd have thought something like "/usr/lib/pear" would be more appropriate?

Doesn't actually make any technical difference, by the way.

But more specifically for your issue, have you checked what path PEAR uses for library files? It may be a configuration in php.ini.
Post Reply