Testing PHP Applications using PHP

Testing PHP Applications

Audience:

  • PHP developers who need to write tests for their applications
  • QA engineers with a background of PHP who need to write automated tests for an application written in PHP

Objectives:

  • Be able to write unit, integration and system tests in PHP.
  • Use the testing frameworks of PHP.
  • Be able to add tests to an existing application.
  • Allow writing both black box and white box tests.

Course format

The regular length of the course is 16 academic hours including about 50% time for hands-on exercises. It is usually given in 2 days (9:00-17:00) but it can be spread to a longer period.

Prerequisites:

At least 6 month experience as a PHP programmer or taking an introductory PHP course prior to this class.

Content

  • First we'll learn about the basic tools of testing and the test frameworks available in PHP (PHPUnit, SimpleTest).
  • Then, we'll expand our set of tools in order to test in more interesting ways.
  • The test will cover unit, integration, system and even acceptance testing with both white- and black-box testing in mind.
  • Topics covered in the training include an introduction to the SimpleTest and PHPUnit testing frameworks, using mock objects, testing existing code, TDD - Test Driven development

Detailed Syllabus:

  • Introduction to testing, why, when, who and how ?
  • Understanding the basic tasks of the QA engineer
  • Introduction to SimpleTest
  • Introduction to PHPUnit
  • Reporting framework
  • Introduction to TAP - the Test Anything Protocol
  • Extending the testing framework
  • Setting up continuous integration (smoke testing)
  • Testing web applications using the command line
  • Testing already existing application
  • Several ways to refactor code
  • Web 2.0 application testing
  • Selenium
  • Testing the database
  • Testing files
  • Introduction to Extreme Programming and Test Driven Development
  • Building random regression testing tool
  • How PHP itself is tested