23459 Posts in 18906 Topics by 2877 members
|Go to End|
23 December 2009 at 10:51am
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?
27 December 2009 at 3:32pm
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
5 January 2010 at 10:26am
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:
include_path = ".;C:/wamp/bin/php/php5.2.6/PEAR;"
thanks again for the help,
5 January 2010 at 10:35am
actually, i didnt need to adjust the environment variables at all.. just changing the include path and restarting apache worked.
|Go to Top|