Wednesday, November 30, 2011

How to install PHP Unit


How to install PHP Unit in window xampp:

PHPUNIT is the de-facto standard for unit testing in PHP projects. It provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.
as well as to test the functionality to test work properly.


First of all you need to upgrade PEAR.
PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide:


A structured library of open-source code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP, specified here
The PHP Extension Community Library (PECL), see more below
A web site, mailing lists and download mirrors to support the PHP/PEAR community


more information visit:
http://pear.php.net/manual/en/about.pear.php


Steps to install PHPUNIT.


Open command prompt and go to directory  c:\xampp\php
first determine the pear info
type command "pear info pear" without quotes.


You need version 1.9.1 at least. If not type " pear upgrade pear "
When upgrade it then type follow this command


pear clear-cache 
pear config-set preferred_state beta


php go-pear.phar
pear clear-cache 
pear update-channels
pear upgrade --alldeps -f 
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear channel-discover components.ez.no
pear config-set preferred_state beta
pear install --onlyreqdeps phpunit/PHPUnit


once it done type "phpunit" to check it.

Sunday, November 27, 2011

How to revert SVN or roll back to the previous subversion.

How to revert your application to the previous stag after the wrong commit. really in subversion you can't go back but you can merge your copy to the previous repository subversion.And then correct your mistake.


follow this steps:
1. Open your Terminal/Command Prompt and go to your SVN directory.
    This step will perform dry run.
2. svn merge --dry-run -r [current_version]:[previous_version] http://yourrepositorypath.com/projectname/trunk


This step will perform merge operation.
3. svn merge -r [current_version]:[previous_version] http://yourrepositorypath.com/projectname/trunk


4. svn commit -m "Reverted to revision [previous_version]"


Optional step to see the different of your revision.
5.svn diff -r [current_version]:[previous_version] 


6.SVN update.


Hopefully this would be help.