Print this page
Monday, 03 May 2010 11:59

Setting up the current Joomla PHPUnit Tests on Netbeans

Written by
Rate this item
(1 Vote)

Like everyone else who writes Netbeans has recently included PHPUnit with its 6.8 version. I have the linux distribution, and am new to this so I am recording it for others to use.

The Prelims:

  1. Start a new project in Netbeans and extract J!1.5 to the source directory.
  2. Run through the Joomla installation process.

Get the Unit Test from Joomla! SVN.

    1. Checkout the unittest from the Joomla! SVN repository.
    2. Navigate Teams->Subversion->Checkout
    3. Put the following into the "Specify the location of Subversion Repository"
http://joomlacode.org/svn/joomla/testing/trunk/1.5/unittest PHPUnit, Joomla!, Joomla, Joomla 1.5, Netbeans Joomla, Unit Testing Joomla, Joomla Unit Test, Joomla Unit Testing Netbeans, Netbeans Joomla UnitTesting
  1. Put 'anonymous' into the username field.
  2. click "Next"

After you have done that you should be connected to the repository, if not, you'll have to try again. Now we need to specify what we want to check out.

  1. In the Repository Folder(s) field put:
    testing/trunk/1.5/unittest
  2. After that, where it says "Local Folder", browse to the root your local Joomla installation.
  3. Then click finish.
Netbeans will ask you if you want to create a project for your checkedout unit tests. You could have done this here instead of at the beginning if you like. Also note that you have a new directory called 'unittest'.

Many of you have probably gotten this far by yourself! CONGRATS!

Configuring The Project Properties

Now we need to configure the Project Properties and tell it where to find the 'bootstrap.php' file and 'phpunit.xml' configuration file.

    1. So go ahead and right click on your newly created Joomla Project and scroll down to Properties.
    2. For both of the locations mentioned above just navigate to both of them (they are both in the 'unittest' directory in your Joomla project)

PHPUnit, Joomla!, Joomla, Joomla 1.5, Netbeans Joomla, Unit Testing Joomla, Joomla Unit Test, Joomla Unit Testing Netbeans, Netbeans Joomla UnitTesting

  1. Having done that, just click 'OK'.

 

You should be good to go! Try it yourself. You need to test a file that has a test written for it. I picked /libraries/joomla/base/object.php for mine and it worked like a charm.

Good luck all!

You can "How to Get it Running" on the Joomla Wiki.

 

Read 9729 times Last modified on Tuesday, 15 January 2013 18:36
Cameron

Cameron is a PHP Application Developer and consultant and spends much of his time furthering the business goals of his company Magnetic Merchandising Inc. which he started in 2005.

Cameron has provided technical deployment and consultation for many entities since starting MMI. Much of that work has been in complex hosted auction platforms, professional Joomla! deployments and extension development and sales.

As such, Cameron has acquired a deep technical skill-set, a sensitivity to client needs, and the ability to produce anything those clients can visualize.

Everyday, he actively seeks out and becomes familiar technologies that will give MMI clients maximum return for their web development and general e-presence dollar.

magneticmerchandising.com

Latest from Cameron