Categories
Linux PHP

Installing PHPUnit on Ubuntu

Summary: I am on Ubuntu 11.10 and have the necessity to install PHPUnit. From my past experience, I know that installing via repository installs old version + fails to run. So I decided to install it via PEAR. Here’s a walk through!

Upgrade PEAR
Damn! The shipped version of pear via the “php-pear” package is outdated. The first thing we need to do is upgrade our PEAR setup. We have to ask pear to upgrade itself!

That should upgrade our pear to the latest version available!

Setup PHPUnit
To install PHPUnit, we have to set auto discovery turned on and discover the PHPUnit PEAR channel. Then we force install PHPUnit with all dependencies. That’s simple!

If everything goes okay, we have a working setup of PHPUnit by now! Type “phpunit –version” on console and check out the output! Ooops! It didn’t work! We’re getting an error message regarding “require_once()”. The issue is obvious, the PEAR directory which contains all PEAR packages haven’t been added to the php include_path.

Fix it this way:

Vim editor window will open with the empty buffer. If you’re not comfortable with vim, just use another text editor. Type in the following directives:

Save and quit. We had to do this manually because pear doesn’t automatically set the include_path to the pear location (which is “/usr/share/php/”).

Now try on terminal:

The output should look like:

Happy Unit testing!

Categories
Linux

Ubuntu 11.10 Fix: Unplugging Power Cable Suspends Notebook

The scenario is simple. I am using Ubuntu 11.10 64bit on my Compaq Presario CQ42. When power cuts or I unplug the adapter, I get a warning message that battery is critically low and it suspends a few seconds later. After searching for a while I found the solution.

Use this following command on Terminal:

It should solve the problem! 🙂

Categories
Linux

Displaying Skype on Notification Area in Ubuntu 11.10

I am using Ubuntu 11.10 64 bit (don’t ask me why! grr!) and I hate Unity. Besides all the inconvenience – the Skype icon doesn’t appear on the notification area. From Google found this solution:

It works! 😀