Category Archives: Uncategorized

PHP : First Unit Test

Code to be tested

// Check.php
class Check {
	public function spitFalse() {
		return false;
	}	
	public function spitTrue() {
		return true;
	}
}

Test Code

// CheckTest.php
require_once('Check.php');
class CheckTest extends PHPUnit_Framework_TestCase
{
	public function setUp(){ }
	public function tearDown(){ }
	public function testSpitFalse() {
		$chk = new Check();
		$this->assertFalse($chk->spitFalse());
	}	
	public function testSpitTrue() {
		$chk = new Check();
		$this->assertTrue($chk->spitFalse());
	}
}

Run Test Code

phpunit CheckTest

Result

OK (2 tests, 2 assertions)
Advertisements

LINUX : Installing debug version of Flash player

Download flash player debug version (flashplayer_11_plugin_debug.i386.tar.gz).

Untar it to a convenient place (/usr/sw)

sw]# tar -zxvf flashplayer_11_plugin_debug.i386.tar.gz

Copy the .so file to /usr/lib/mozilla/plugins directory

sw]# mv libflashplayer.so /usr/lib/mozilla/plugins/

Workaround for SELinux

sw]# chcon -t textrel_shlib_t /usr/lib/mozilla/plugins/libflashplayer.so 

Open Firefox, type about:plugins on the address bar and hit Enter.

LINUX : Installing Ant

Create a directory for ant

~]# mkdir /usr/ant

Copy and extract the .tar.gz archive to /usr/ant directory

ant]# tar -zxvf apache-ant-<version>-bin.tar.gz 

Set PATH

ant]# vim /usr/ant

Add following lines to the end of the file

ANT_HOME=/usr/ant/apache-ant-1.8.2; export ANT_HOME
PATH=$ANT_HOME/bin:$PATH; export PATH

I said Hello

Saturday is the best day of the week to start a blog, hopefully 😀