Posts

Showing posts from July, 2014

PHPUnit

Installation on Debian/Unix: wget https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar mv phpunit.phar /usr/local/bin/phpunit phpunit --version Or install from composer, {     "require-dev": {         "phpunit/phpunit": "^5.4"     } } OR composer global require-dev phpunit/phpunit For global access, composer global install Files will be downloaded to ~/.composer/vendor/bin/ So, we need to set the PATH variable for global access, export PATH=~/.composer/vendor/bin:$PATH For update package, composer global update How phpunit works in Yii: All the test files need to be follow the unique naming convension, file name should be end up with 'Test' : databaseTest.php class name shoud be the same as filename and it should extends from phpunit testcase class, ex: include_once  ('framework/database.php'); - The original class file class databaseTest extends PHPUnit_Framework_TestCase { protected $connec

xdebug on Debian

Installation: sudo apt-get install php5-xdebug Can check whethere it installed or not by looking at phpinfo() We can change any initial configuration settings by changing xdebug specific ini files located at /etc/php5/fpm/conf.d/20-xdebug.ini Can find the exact ini location by looking at the phpinfo() OR just run find command from command line, find /etc -name "xdebug.ini" Profiling: Need to change xdebug.ini file as follow, xdebug.profiler_enable = On xdebug.profiler_output_dir="/tmp/xdebug" More info at: http://devzone.zend.com/1139/profiling-php-applications-with-xdebug/ Debug codes with break points: Netbeans 8 comes with native support with xdebug. The following config needs to be done on xdebug.ini or set it on run time, xdebug.remote_connect_back = On So, the final configuration changes as bellow, xdebug.remote_enable = On xdebug.profiler_enable = On xdebug.profiler_output_dir = "/tmp/xdebug" xdebug.dump_undefined

GIT Help

################### Configurations #################### # Make ssh connection with github (from Debian) - Generate public/private key pair on local computer cd ~/.ssh ssh-keygen -t rsa -C "your_email@example.com" - Add private key to the local ssh-agent eval `ssh-agent -s` ssh-add ~/.ssh/id_rsa - Copy public key to clipboard clip < ~/.ssh/id_rsa.pub - Linux pbcopy < ~/.ssh/id_rsa.pub - Unix - Add public key to Github https://github.com/settings/ssh - Check ssh connection with github ssh -T git@github.com # When git asking username and password every time you commit, then you have cloned the repository using https rather using ssh. To correct that mistake git remote set-url origin git@github.com:dilumdarshana/AngularJS.git # When git contribution does not show on the profile graph do this, git config --global user.email " YOUR EMAIL ADDRESS " #  git config : To config settings eg. git config --global user.name = 'Dilum Darshana