Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » UnitTest Error

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2001 Views
  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    UnitTest Error Link to this post

    Hi Everyone,
    I'm trying to set up unit tests, and installed pear and PHPUnit-3.3.17 on wamp. PHPUnit says it installed ok.
    i restarted apache, and visited localhost/mysite/dev/tests/ and receive this error on all tests.

    Fatal error: Class 'PHPUnit_Framework_TestSuite' not found in C:\wamp\www\mysite\sapphire\dev\TestRunner.php on line 144

    i checked out this file and dont see a class definition for PHPUnit_Framework_TestSuite. i'm running SS version 2.3.3, and also tested with SS 2.3.1

    can anyone let me know what i'm missing?
    thanks alot,
    -Chris

  • tobych
    Avatar
    Community Member
    97 Posts

    Re: UnitTest Error Link to this post

    PHPUnit_Framework_TestSuite is a class from PHPUnit. PHPUnit/Framework.php must be in your include path so the code at the top of dev/TestRunner.php finds it. I imagine this is best done in .htaccess if you can; I don't know the best place to do this in the SilverStripe code itself. For code snippets for doing adding a folder to the include path, see http://www.silverstripe.org/blog-module-forum/show/267774?start=0#post273560

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: UnitTest Error Link to this post

    Hi Tobych,
    thanks for the reply.
    I just got it working.

    i had to do a few things to get it to work..
    i manually added path environment variables to let pear and phpunit run. (added ;C:\wamp\bin\php\php5.2.6\ to the path)
    my pear installation installed the PHPUnit folder in c:\wamp\bin\php\php5.2.6\PEAR. i needed to change the php.ini file to reflect that:

    (php.ini)
    include_path = ".;C:/wamp/bin/php/php5.2.6/PEAR;"

    thanks again for the help,
    -Chris

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: UnitTest Error Link to this post

    actually, i didnt need to adjust the environment variables at all.. just changing the include path and restarting apache worked.

    thanks again,
    -Chris

    2001 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.