Results 1 to 9 of 9

Thread: PHPUnit Installation

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    PHPUnit Installation

    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)
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: PHPUnit Installation

    There's another php.ini file in xampp/apache/bin - make sure the include_path in there is set properly too.
    Last edited by SambaNeko; Dec 2nd, 2009 at 01:50 AM. Reason: Typo.

  3. #3

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: PHPUnit Installation

    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.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  4. #4

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: PHPUnit Installation

    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.)
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  5. #5
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: PHPUnit Installation

    I wasn't fond of Eclipse when I tried it out a few years ago...

  6. #6

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: PHPUnit Installation

    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.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: PHPUnit Installation

    oh. I'm not a huge fan of IDEs. I use Notepad++.

  8. #8
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: PHPUnit Installation

    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.

  9. #9
    New Member aaxc's Avatar
    Join Date
    Aug 2011
    Posts
    1

    Unhappy Re: PHPUnit Installation

    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
    Code:
    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:\Progra~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 ...


    Any suggestions what simple thing am I doing wrong?

    Thanx already.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width