PDA

Click to See Complete Forum and Search --> : PHPUnit Installation


StrangerInBeijing
Dec 1st, 2009, 03:36 AM
I never needed to bother with PEAR, so that might be where my problem lies.

My setup: Win7, XAMPP (d:/Apps/xampp)
In my php.ini (D:\Apps\xampp\php) : include_path = ".;D:\Apps\xampp\php\PEAR"

Used the command line and:
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit

After that I have D:\Apps\xampp\php\PEAR\PHPUnit (with Framework.php in there).

Created a php script starting with "require_once 'PHPUnit/Framework.php';" , however get the following error:
Warning: require_once(PHPUnit/Framework.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in D:\Repository\StackTest.php on line 3

Fatal error" require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'PHPUnit/Framework.php' (include_path='.;D:\Repository') in D:\Repository\StackTest.php on line 3

Any ideas? (for what it matter, I just got working with php scripts in eclipse, and I could run normal scripts without problems)

SambaNeko
Dec 1st, 2009, 11:27 PM
There's another php.ini file in xampp/apache/bin - make sure the include_path in there is set properly too.

StrangerInBeijing
Dec 2nd, 2009, 01:57 AM
Decided to go back and remove XAMPP. Installed Apache, MySQL, PHP and PhpMyadmin separately (currently swearing a lot, so it will work soon)
Thanks for the reply though. Appreciated, and can use it for the other developers that don't even know what is apache.

StrangerInBeijing
Dec 4th, 2009, 01:38 AM
By the way, I realized that when you run PHP scripts in Eclipse, you have to set the project's "Include Path" (PHP Perspective->Right Click Project->Include Path->Configure Include Path->Libraries Tab-> Add External Source Folder) to the include path you have in your php.ini (which seems to get ignored by Eclipse.)

SambaNeko
Dec 4th, 2009, 10:51 AM
I wasn't fond of Eclipse when I tried it out a few years ago...

StrangerInBeijing
Dec 4th, 2009, 10:41 PM
Hmmm. I kind of felt that way too the first week or so. But as I was expected to use it, I just had to keep going.
Start liking it more and more (or maybe it's just a positive attitude for having a proper boss finally) discovering new things day after day (which is fun in a way)
Missing minor things one take for granted in most IDE's, but in a way it's like having visual studio team edition with ReSharper....and it's free.

kows
Dec 5th, 2009, 01:26 AM
oh. I'm not a huge fan of IDEs. I use Notepad++.

SambaNeko
Dec 5th, 2009, 05:50 PM
It didn't feel very intuitive to me - like you mentioned here: you have to set a special include_path, and you have to go through "PHP Perspective->Right Click Project->Include Path->Configure Include Path->Libraries Tab-> Add External Source Folder" to get to it? It seems convoluted to me. But I'm not big on IDEs in general I suppose. I just use Notepad2 and XAMPP for PHP development.

aaxc
Aug 16th, 2011, 08:40 AM
Hello there, I know this is an old post, but I'm trying to install PHPUnit at work right now and am getting errors I can't find the solution to:

1st Method:
I installed on custom Apache installation, but when I run it, I get
Fatal error: require_once(): Failed opening required 'Text/Template.php' (include_path='D:\Program Files\PHP\PHPUnit;.;D:\Progra~1\PHP;D:\Progra~1;D:\Progra~1\PHP\PEAR;D:\Progra~1\PHP\PHPUnit;D:\Prog ra~1\PHP\PHPUnit\PHPUnit;') in D:\Program Files\PHP\PHPUnit\PHPUnit\Framework\TestCase.php on line 46

Why is it looking for 'Text/Template.php' in the core files, but it is not in the original installation ...

2nd Method:
I also installed WAMP server with PHPUnit but when I run that one, I get nothing at all ...
http://i55.tinypic.com/1h8okx.jpg

Any suggestions what simple thing am I doing wrong?

Thanx already.