Hi ,
i am new to php, so i appreciate any help you might be able to give me. Its okay for me if you point out my mistakes. I am extremely sorry for writing such a long email.
I am testing/analyzing unit test framework to use for PHP. I found that there are currently two things which are going on in this area:
PHPUnit2 (http://www.phpunit.de/en/index.php)
SimpleTest (http://www.lastcraft.com/simple_test.php)
First i m trying out phpunit2. I downloaded the tar (zip) file and started using it. Later i realised that i need to do something with pear. I don't know how to do pear install but from the link which I found from Phpunit2 site, it said you can either download the package or install it using pear. I downloaded the package and wheni exploded the (tar or zip) file i got the following structures in it.
PHPUnit2 dir
package.siz file
package.xml file
Within PHPUnit2 directory, I have following directories" Extensions, Framework, Runner, Tests, TextUI and Util and couple of files.
I am using php-5.0.3 installable for Windowx XP. In my php installation I have Pear directory and within php directory i have dev, ext, extra and pear directory and many dlls and files. I have go-pear.bat file in the same directory. I tried to run it and install and got the following:
/
The following PEAR packages are bundled with PHP: DB, Net_Socket, Net_SMTP,
Mail, XML_Parser, PHPUnit.
Would you like to install these as well? [Y/n] : y
Loading zlib: ok
Using local package: PEAR.............ok
Using local package: Archive_Tar......ok
Using local package: Console_Getopt....ok
Using local package: XML_RPC..........ok
Bootstrapping: PEAR...................(local) ok
Bootstrapping: Archive_Tar............(local) ok
Bootstrapping: Console_Getopt.........(local) ok
Downloading package: DB...............ok
Downloading package: Net_Socket.......ok
Downloading package: Net_SMTP.........ok
Downloading package: Mail.............ok
Downloading package: XML_Parser.......ok
Downloading package: PHPUnit..........ok
Extracting installer..................ok
install ok: PEAR 1.3.1
install ok: Archive_Tar 1.2
install ok: Console_Getopt 1.2
install ok: XML_RPC 1.1.0
Could not get contents of package "C:\Documents and Settings\dipesh\Local Settings\Temp\gop26F.tmp\DB". Invalid tgz file.
Press any key to continue . . .
/
I don't know why did error came? Was installation prorpely done.
Later i ran the command pear install --alldeps PHPUnit2 and it has installed the PhpUnit2 directory in pear directory which was under php directory. Now do i have to set some parameters in php.ini file? Because still i am getting the error like /PHPUnit2/Framework/TestCase.php failed to open stream in the require_once line of MoneyTest.php file.
There is no complete documentation available for this so i thought of doing this and putting it somewhere where it can be used by all the developers. So if anyone came across this and made it working please inform me how should i go about using phpunit2 or shall i try out simpletest.
Your help will be highly appreciated.
Thanks in advance.
Regards,
Dipesh