A PHPUnit is a testing framework to write and run tests on PHP code. A test file can be created for each class, function and file. PHPUnits allow PHP developers to incrementally build test suites to constantly review progress and detect unintended side effects.

To create and run a PHPUnit Test Case:

  1. In PHP Explorer view, right-click the file you want to test and select New | PHP Unit TestCase.
  2. Fill in the required information in the New PHPUnit Test Case dialog.
  3. Click Finish to create your Test Case file.
  4. Edit the test functions in your new PHPUnit Test Case file by writing appropriate tests for the relevant functions.
  5. Run the PHPUnit Test by going to Run | Run As | PHPUnit from the Menu Bar -or- right-clicking the file in PHP Explorer view and selecting Run As | PHPUnit.

Post By Gishore J Kallarackal (2,121 Posts)

Gishore J Kallarackal is the founder of techgurulive. The purpose of this site is to share information about free resources that techies can use for reference. You can follow me on the social web, subscribe to the RSS Feed or sign up for the email newsletter for your daily dose of tech tips & tutorials. You can content me via @twitter or e-mail.

Website: → Techgurulive