No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



PFTT is a cross-platform and multi-platform high-speed PHP Test tool which supports unit tests, PHPTs for PHP-Core and PHPUnit tests for PHP Applications, along with comparison, debuging, performance, UI Automation, smoke and multi-scenario support.


PFTT has and can mean many different things:

  • PHP Function Test Tool
  • PHP Filesystem Test Tool
  • Practically Formulated Test Tool
  • PHP Fast Test Tool
  • PHP Full Test Tool
  • Pftt is a Fun Test Tool



API Documentation

Important Classes

  • CliPhptTestCaseRunner - Executes a single PHPT Test Case (using the CLI SAPI) and evaluates
  • Host - Abstracts host management so client code doesn't need to care if host is local or remote(ssh)
  • ScenarioSet - Models 90 sets of different Scenarios to test PHP in
  • PhptTestCase - Models a PHPT Test case


  • Install Java SE 6 or 7 (JRE or JDK)
  • download PFTT ZIP
  • decompress ZIP to C:\php-sdk\PFTT\current (Windows) or ~/php-sdk/PFTT/current (Linux)
  • Note: should have directories like c:\php-sdk\PFTT\current\bin not c:\php-sdk\PFTT\current\pftt-version\bin
    • add PFTT to $PATH or %PATH% (optional)
      • Windows
      • set PATH=c:\php-sdk\PFTT\current\bin;%PATH%
      • To make it permanent, open System Properties from Control Panel (can also right-click on Start > Computer and click My Computer)
      • Click Advanced then Environment variables
      • Find PATH under System variables and add C:\php-sdk\PFTT\current\bin
      • Linux (bash)
      • Open ~/.bash_profile
      • Add export PATH=$PATH:~/php-sdk/PFTT/current/bin
      • chmod +x ~/php-sdk/PFTT/current/bin/pftt


PFTT has a builtin upgrade command. Just do:

> pftt upgrade

and you'll have the latest version.


Find and download newest 5.3 snapshot build that provides an NTS build

> pftt release_get 5.3 NTS newest

Find and download second-newest(previous before newest) 5.4 snapshot build that provides an NTS build

> pftt rget 5.4 NTS previous

Stores builds and test-packs in C:\Php-sdk (Windows) or ~/php-sdk (Linux). For convenience can do

> pftt rgn 5.3 nts

List releases (by build, branch, both, or all)

> pftt release_list 5.3
> pftt release_list NTS
> pftt rl nts 5.3
> pftt rl

Download specific release (test-pack and build)

> pftt rg MASTER TS rc165a0b

Run all PHPTs from the test-pack

> pftt phpt_all C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567

Runs PHPTs only from list in SKIP_list_file (can add comments to lists with a ; or #)

> pftt phpt_list C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 SKIP_list_file

Runs PHPTs that contain 021 (name fragment) in their name

> pftt phpt_named C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 021

NOTE: On Windows PFTT will prompt you to elevate it to Administrator privileges for some operations to configure Windows Error Reporting and firewall

If build or test-pack not in current directory, automatically checks php-sdk (so you can ommit c:\php-sdk, etc...)

> pftt phpt_all php-5.4.7-win32-vc9-x86 php-test-pack-5.4-r1234567

Opens a GUI to efficiently review large amounts of tests

> pftt -gui phpt_all C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 pftt -gui -config config_file phpt_list C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 pftt -gui -config config_file phpt_named C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567

Shows help info (additional commands, etc...)

> pftt -help

Functional Build Comparison(FBC) Reports

Run one test pass

> pftt phpt_all C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 Or pftt phpt_list C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 SKIP_list_file Or pftt phpt_named C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234567 021

Run a second test pass, using a different build and/or test-pack

> pftt pa C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234568 Or pftt phpt_list C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234568 SKIP_list_file Or pftt phpt_named C:\php-sdk\php-5.4.7-win32-vc9-x86 C:\php-sdk\php-test-pack-5.4-r1234568 021

PFTT will automatically generate an FBC report and display it using system default web browser


  • Install Eclipse Java IDE 4.2 (Juno), not Eclipse Classic see
    • download and decompress .zip file
  • Run Eclipse, the default value for workspace is ok
    • from decompressed eclipse folder, run eclipse.exe (Windows) or eclipse (linux)
  • Install Groovy Plugin:
    • Help > Install New Software
    • Add
    • Enter 'Groovy' for name and for location and click ok/add
    • Check Groovy-Eclipse and click next through all the screens -You may get a warning about groovy-eclipse not being signed, ignore and install anyway. Also, Eclipse will need to restart.
  • On Windows, find c:\php-sdk\PFTT\Current.classpath and .project. Look at their Properties in Windows Explorer and make sure the 'Read Only' and 'Hidden' attributes are not set. Clear it if it is, or Eclipse will get Access Denied errors.
  • File > Import > General > Existing project
  • Choose C:\php-sdk\PFTT\current
  • That should be it (PFTT comes with eclipse .project and .classpath files which already have all the correct settings)
  • By setting Host#Dev > 0, you can have PFTT use php-sdk\PFTT\Dev-N and php-sdk\Dev-N instead of php-sdk\PFTT\current, to run stable and multiple development versions of PFTT side-by-side

Adding Scenarios

To add any test Scenario, implement Scenario and instantiate it in Scenario#getAllScenarios.

Database Scenario

More specifically, to add a database scenario (MySQL, Firebird, etc...) implement AbstractDatabaseScenario and add it to Scenario#getAllScenarios.

SAPI Scenario

To add a SAPI Scenario (CLI, web server, etc...), implement AbstractSAPIScenario and add it to Scenario#getAllScenarios.

If you want to implement a Web Server scenario (IIS, Apache, etc...), implement AbstractWebServerScenario, a subclass of AbstractSAPIScenario, which provides additional methods for testing PHPT tests using HTTP against PHP running under web servers.

Adding a PHPUnit Application

If the application uses PHPUnit, implement PhpUnitAppTestPack. If it uses something else or something custom (like Wordpress), implement PhpAppTestPack.