PHPUnit2

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHPUnit2

Postby youngfowl » 06. October 2006 16:42

Does anyone know how to use the PHPUnit2 for Unit Testing in XAMPP? Maybe the development team here can help. I would also like to help out with the documentation for using PHPUnit2 under XAMPP as a way of saying than you and helping others out.

Rgds,
Glenn Agilan Elangow
youngfowl
 
Posts: 3
Joined: 06. October 2006 16:21

Like in the manual

Postby kmilo » 06. October 2006 17:36

As say in http://www.phpunit.de/pocket_guide/3.0/ ... ation.html :

cd xampp\php
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
now add xampp\php to your PATH (Control Panel -> System -> Advanced Options -> Enviroment Vars -> PATH)

Read http://www.onlamp.com/pub/a/php/2005/12/08/phpunit.html (is the more recent docs I know)

And susbcribe to the mail list: http://www.phpunit.de/wiki/MailinglistsAndIrc
kmilo
 
Posts: 3
Joined: 06. October 2006 17:30

PHPUnit2 : Fatal Error

Postby youngfowl » 06. October 2006 21:28

Hey Kmilo,

Thanks for your speedy reply. Followed your steps..this is the error message I got....

Fatal error: Class 'PEAR_Config' not found in C:\Program Files\xampp\php\pear\PHPUnit2\Runner\StandardTestSuiteLoader.php on line 80
youngfowl
 
Posts: 3
Joined: 06. October 2006 16:21

Postby kmilo » 06. October 2006 22:46

When you got that error?

PDT:
I use XAMP not XAMP Lite
kmilo
 
Posts: 3
Joined: 06. October 2006 17:30

When Running phpUnit ArrayTest

Postby youngfowl » 06. October 2006 22:54

1) I created a Test File called ArrayTest (not ArrayTest.php)

Code: Select all
<?php
require_once 'PHPUnit2/Framework/TestCase.php';

class ArrayTest extends PHPUnit2_Framework_TestCase {
    public function testNewArrayIsEmpty() {
        // Create the Array fixture.
        $fixture = Array();

        // Assert that the size of the Array fixture is 0.
        $this->assertEquals(0, sizeof($fixture));
    }

    public function testArrayContainsAnElement() {
        // Create the Array fixture.
        $fixture = Array();

        // Add an element to the Array fixture.
        $fixture[] = 'Element';

        // Assert that the size of the Array fixture is 1.
        $this->assertEquals(1, sizeof($fixture));
    }
}
?>


From the Command Prompt
Code: Select all
c:\Program Files\xampp\php\phpUnit ArrayTest


Thanks for the help man !!!
youngfowl
 
Posts: 3
Joined: 06. October 2006 16:21


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 210 guests