2010年4月15日 星期四

PHPUnit

Change to your php5 installation folder
cd c:\php5 

You have to install pear if you don't have it
go-pear.bat 


For convenience, a REG file is available under C:\php5\PEAR_ENV.reg
This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.

Start to install phpunit
pear install phpunit/PHPUnit 

optional for phpunit
pear install pear/Image_GraphViz

optional for phpunit
pear install --alldeps pear/Log

Check the installation is fine

phpunit --version
PHPUnit 3.4.12 by Sebastian Bergmann.


Modify phpunit.bat, change PHPBIN to your realpath, like this
set PHPBIN="C:\php5\php.exe"


Set envirment variable "PATH"
PATH=....;C:\php5
and we can call phpunit.bat in anywhere

What kind of assertion do we have ?
Check this, PHPUnit\framework\Assert.php

Examples:
http://www.phpunit.de/manual/current/en/test-driven-development.html

沒有留言:

張貼留言