PHPackages                             nazar-pc/phpt-tests-runner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. nazar-pc/phpt-tests-runner

ActiveLibrary[Testing &amp; Quality](/categories/testing)

nazar-pc/phpt-tests-runner
==========================

Runner for PHPT tests (with few differences comparing to original PHPT format)

1.4.1(8y ago)82.8k3[2 issues](https://github.com/nazar-pc/phpt-tests-runner/issues)0BSDPHPPHP &gt;=7.0

Since May 11Pushed 8y ago2 watchersCompare

[ Source](https://github.com/nazar-pc/phpt-tests-runner)[ Packagist](https://packagist.org/packages/nazar-pc/phpt-tests-runner)[ Docs](https://github.com/nazar-pc/phpt-tests-runner)[ RSS](/packages/nazar-pc-phpt-tests-runner/feed)WikiDiscussions master Synced today

READMEChangelog (5)DependenciesVersions (12)Used By (0)

PHPT tests runner - Runner for PHPT tests (with few differences comparing to original PHPT format)
--------------------------------------------------------------------------------------------------

[](#phpt-tests-runner---runner-for-phpt-tests-with-few-differences-comparing-to-original-phpt-format)

```
PHPT Tests runner

Usage:
  phpt-tests-runner [-h] [-c] [-C] [-b binary] [files] [directories]

Arguments:
  -h Print this help message
  -b Specify custom PHP binary to be used (current is used by default)
  -c Force colored output
  -C Force no colored output

Examples:
  Execute tests from tests directory:
    phpt-tests-runner tests
  Execute tests single test:
    phpt-tests-runner tests/sample.phpt
  Execute tests from tests directory, but skip slow tests using environment variable:
    SKIP_SLOW_TESTS=1 phpt-tests-runner tests

PHPT Format:
  This runner uses modification of PHPT format used by PHP itself, so that it can run many original PHPT tests without any changes.

  PHPT test if text file with *.phpt extension.
  Each file contains sections followed by section contents, everything before first section is ignored, you can use it for storing test description.

  Required sections are --FILE-- and one of [--EXPECT--, --EXPECTF--, --EXPECTREGEX--].

PHPT sections supported:
  --FILE--        The test source code
  --EXPECT--      The expected output from the test script (will be executed as PHP script, so it might be code as well as plain text)
  --EXPECTF--     Similar to --EXPECT--, but it uses substitution tags for strings, spaces, digits, which may vary between test runs
    The following is a list of all tags and what they are used to represent:
      %s One or more of anything (character or white space) except the end of line character
      %S Zero or more of anything (character or white space) except the end of line character
      %a One or more of anything (character or white space) including the end of line character
      %A Zero or more of anything (character or white space) including the end of line character
      %w Zero or more white space characters
      %i A signed integer value, for example +3142, -3142
      %d An unsigned integer value, for example 123456
      %x One or more hexadecimal character. That is, characters in the range 0-9, a-f, A-F
      %f A floating point number, for example: 3.142, -3.142, 3.142E-10, 3.142e+10
      %c A single character of any sort (.)
  --EXPECTREGEX-- Similar to --EXPECT--, but is treated as regular expression
  --SKIPIF--      If output of execution starts with `skip` then test will be skipped
  --INI--         Specific php.ini setting for the test, one per line
  --ARGS--        A single line defining the arguments passed to php
  --CLEAN--       Code that is executed after a test completes

PHPT tests examples:
  Examples can be found at  (taking into account differences here)

Main differences from original PHPT tests files:
  1. --TEST-- is not required and not even used (files names are used instead)
  2. Only sub-set of sections supported and only sub-set of --EXPECTF-- tags
  3. --EXPECT*-- sections are interpreted as code and its output is used as expected result

```

Requirements:
-------------

[](#requirements)

- PHP 7.0+

How to use?
-----------

[](#how-to-use)

Simply add dependency on `nazar-pc/phpt-tests-runner` to your project's `composer.json`:

```
{
    "require-dev": {
        "nazar-pc/phpt-tests-runner": "1.*"
    }
}
```

Then execute tests as following:

```
vendor/bin/phpt-tests-runner tests

```

Or if you need environment variables to propagate into tests:

```
php -d variables_order=EGPCS vendor/bin/phpt-tests-runner tests

```

Alternatively you can install it globally using Composer like this:

```
sudo COMPOSER_BIN_DIR=/usr/local/bin composer global require nazar-pc/phpt-tests-runner
```

`COMPOSER_BIN_DIR=/usr/local/bin` will instruct Composer to install binary to `/usr/local/bin` so that you'll be able to call just `phpt-tests-runner` after installation. Alternatively you can skip it and add `~/.composer/vendor/bin/` to your PATH.

Contribution
------------

[](#contribution)

Feel free to create issues and send pull requests, they are highly appreciated!

License
-------

[](#license)

Free Public License 1.0.0 / Zero Clause BSD License

###  Health Score

32

—

LowBetter than 74% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 91.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~0 days

Total

11

Last Release

2973d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6

1.3.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/050c23d89354489e351eed5096aa585badd35d2bbe283218bbb8f2516534c513?d=identicon)[nazar-pc](/maintainers/nazar-pc)

---

Top Contributors

[![nazar-pc](https://avatars.githubusercontent.com/u/928965?v=4)](https://github.com/nazar-pc "nazar-pc (21 commits)")[![Nayjest](https://avatars.githubusercontent.com/u/153999?v=4)](https://github.com/Nayjest "Nayjest (2 commits)")

---

Tags

phpphptteststestingtestphpt

### Embed Badge

![Health badge](/badges/nazar-pc-phpt-tests-runner/health.svg)

```
[![Health](https://phpackages.com/badges/nazar-pc-phpt-tests-runner/health.svg)](https://phpackages.com/packages/nazar-pc-phpt-tests-runner)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k488.3M20.8k](/packages/mockery-mockery)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

37417.5M83](/packages/php-mock-php-mock)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33112.0M287](/packages/brain-monkey)[ta-tikoma/phpunit-architecture-test

Methods for testing application architecture

10642.5M11](/packages/ta-tikoma-phpunit-architecture-test)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.0M349](/packages/php-mock-php-mock-phpunit)[fr3d/swagger-assertions

Test your API requests and responses against your swagger definition

138840.4k5](/packages/fr3d-swagger-assertions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
