Welcome to PHPT
PHPT provides a file-based testing framework for PHP that:
- allows capturing of tests with minimal bootstrap code
- allows storing plain-text explanations of test case along side test code
- allows modification of PHP runtime configuration on a per-test case basis
- runs all tests in their own processes
To get started with PHPT, see the Getting Started Guide?. See PHP Quality Assurance's page on writing PHP tests for the format of phpt files.
Installing PHPT
There are several ways? to install PHPT, but the easiest is via it's PEAR Installer compatible channel:
$ pear channel-discover channel.phpt.info $ pear install phpt/PHPT_Core-alpha
Google Summer of Code
PHPT is getting some attention from Cesare Montedonico as part of Google's Summer of Code project. The aim of this project is to get PHPT capable of replacing the antiquated battle-worn run-tests.php file. All documentation related to the GSoC project is kept on the Google Summer of Code page.
Version Control
There are three modules for PHPT: PHPT_Core, PHPT_Ensure, and PHPT_DocTest. They are available via Subversion for anonymous checkout via:
$ svn co https://svn.phpt.info/Core/trunk Core $ svn co https://svn.phpt.info/Ensure/trunk Ensure $ svn co https://svn.phpt.info/DocTest/trunk DocTest
A Git repository is in the works, which all future development moving toward it. In the meantime, feel free to clone the repositories using git-svn. The repositories layout follows the standard trunk/, tags/, branches/ layouts, so cloning with the -s|--stdlayout parameter will work.
Notes from php|architect article
If you're coming here from the article in the March php|architect's article, you might have noticed some of the features mentioned in the article aren't working as described.
DocTest? integration
Naturally, the "oh I've got plenty of time to do that" mentality got me this time. I have had a few brief bursts of productivity on DocTest, but it isn't completed yet. If you're interested in contributing to the project, shoot an email out to the very inactive mailing list and let me know what you're interested in helping with.
Installation via PHPT bundle
Apparently, the PEAR Installer doesn't like remote bundles. I've brought this up on the pear-dev@ mailing list, so hopefully it will be addressed in a future release unless I'm just missing the obvious here and they aren't allowed for good reason. At any rate, you can install the bundle by downloading it directly, or you can install it by doing:
pear install phpt/PHPT_Core-alpha pear install phpt/PHPT_Ensure-alpha
