PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Testing » Testing_DocTest

A Unit Test framework for writing tests in your php code docstrings.

This package is unmaintained.

Download latest release 0.6.0 (archived versions might be outdated)

License: MIT

Description

Testing_DocTest allows the developer to write unit tests directly in the <code></code> blocs of your functions, classes and class methods doc comments.

It comes with a default runner (phpdt) that will parse all your <code></code> blocs and will run the extracted tests.
Running tests is as simple as:

$ phpdt /path/to/your/code

There are several advantages in using Testing_DocTest:
* it makes unit tests writing funnier, easier and quicker (there's no infrastructure to setup, you just install the package, write your code examples tests and you're done !);
* it ensures that doc comments are up-to-date by verifying that all examples work as documented;
* it enforces writing of tutorial documentation, liberally illustrated with input-output examples.

Maintainers

Dependencies

Required

Releases

Bugs

IDStatusTypeVersionDateSummary
#14577ClosedBug0.3.12008-08-28Unmatched code blocks.
#15911ClosedReq2009-02-18Change the color of the Failed Tests Summary to red
#15928ClosedReq2009-02-22Add 'skip all tests except' option to phpdt
#15948Wont fixReq2009-02-26Add ability to enter into interactive mode inside a doctest
#15963ClosedReq2009-03-01Allow the inclusion of an external doctest file
#16371ClosedBug0.4.02009-06-24Installation to wrong location
#16372ClosedBug0.4.02009-06-24phpdt confused by "{$var}" notation
#16393ClosedReq0.4.12009-07-01Better support for file-level code
#18929AnalyzedReq0.5.02011-10-25Shorthand Syntax
#19023OpenReq0.5.02011-11-14Multiple tests in one code block