Skip to content

Installation ​

Requirements ​

  • PHP 8.4 or higher

Composer ​

Install DocTest as a development dependency:

bash
composer require --dev testflowlabs/doctest

After installation, the doctest binary is available at:

bash
vendor/bin/doctest

Verify Installation ​

Run without arguments to test the default paths (docs/ and README.md):

bash
vendor/bin/doctest

If no markdown files contain PHP code blocks, DocTest will exit cleanly with no output.

Framework Bootstrap ​

If your documentation examples need a framework (Laravel, Symfony, etc.), configure a bootstrap file. See Framework Bootstrap for details.

Configuration ​

Create an optional doctest.php in your project root to customize paths, timeouts, and reporters:

bash
touch doctest.php

See Configuration for the full reference.

Released under the MIT License.