PHP Classes

Usage Analysis

Recommend this page to a friend!

      bitvec  >  All threads  >  Usage Analysis  >  (Un) Subscribe thread alerts  
Subject:Usage Analysis
Summary:Issue with PHPUnit_Framework_TestCase
Messages:3
Author:Darren Conyard
Date:2013-01-09 21:45:12
Update:2013-01-09 23:40:13
 

 


  1. Usage Analysis   Reply   Report abuse  
Picture of Darren Conyard Darren Conyard - 2013-01-09 21:45:12
Hi CPK,

I am quite new to PHP, but I think there is something I am missing on line 9 of your example bvt1.php. I have run this script using display errors and the web page displays the following:

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...\bitvec\tests\bvt1.php on line 10

I am wondering if there is a script missing or if this is an internal PHP class. The PHP version I have running is version 5.3.2.

Also, just so that you are aware a couple of required files are not linked correctly in:

prime.php - line 120 (../bitvec.php)
bvt1.php - line 6 (../bitvec.php)
bvt1.php - line 7 (prime.php)

Any help you can provide with this would be greatly appreciated

Best Regards

Darren Conyard

  2. Re: Usage Analysis   Reply   Report abuse  
Picture of CPK Smithies CPK Smithies - 2013-01-09 23:38:44 - In reply to message 1 from Darren Conyard
To run the test, you must install the Pear package phpunit. I don't know how this is done under windows, but under Linux you would enter

$ sudo pear install phpunit

Once you have phpunit installed, you execute the command

$ phpunit

from the main class directory, not the tests subdirectory. You cannot execute the test file directly.

The prime.php file does however give a reasonably clear impression of how bitvec is used and this file can be used as indicated in bvt1.php.

  3. Re: Usage Analysis   Reply   Report abuse  
Picture of CPK Smithies CPK Smithies - 2013-01-09 23:40:13 - In reply to message 1 from Darren Conyard
A further point: in your php.ini you need to make sure that the current directory is in the include_path.