PHPackages                             smytsyk-dev/testspy - 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. smytsyk-dev/testspy

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

smytsyk-dev/testspy
===================

Detector

10PHP

Since Mar 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/smytsyk/testspy)[ Packagist](https://packagist.org/packages/smytsyk-dev/testspy)[ RSS](/packages/smytsyk-dev-testspy/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

How it works
============

[](#how-it-works)

**1. Informer**
---------------

[](#1-informer)

First process should be for keeping test matrix up to date. This script has to be executed after every merge to "master" branch. It requires implementing TestRunnerInterface. Basically command to run all existing tests in the repository.

```
$syncControl = new SyncControl(new Redis_TestSpy_Dao());

$testRunner = new Test_Runner();

$matrixUpdater = new MatrixUpdater($syncControl, $testRunner);
$matrixUpdater->update();

```

**Listener**

TestSpy listener has to be included in PHPUnit xml config. It will allow to check which files are involved while a particular test is running and store it to the storage. Tests with this listener should be triggered in "Informer".

```

        /codebase/php/

```

**2. Spy**
----------

[](#2-spy)

This process is responsible to generate config file with the list of tests which are required to be run for the change in the current branch in comparison with master branch.

It will provide the path to the default config if TestSpy cannot access the storage. It requires to specify:

- path to repository which is going to be under the tests
- path to the bootstrap.php

```
$syncControl = new SyncControl(new Redis_TestSpy_Dao());

$isTestSpyReady = $syncControl->isReady();

if ($isTestSpyReady === false) {
  echo 'default/path/to/config/with/all/tests.xml';
  exit();
}

$pathToRepo     = '/codebase/php_copy';
$branchDetector = new BranchDetector($pathToRepo, new Utilities());

$changedFiles      = $branchDetector->getChangedFiles();
$pathToBaseUnitXml = INCLUDE_PATH . '/tests/conf/phpunit.xml';

$runner = new Runner(
    new Redis_TestSpy_Dao(),
    new PhpUnitConfigBuilder($pathToBaseUnitXml),
    new Utilities(),
    new RunnerConfig(INCLUDE_PATH . '/tests/conf/bootstrap.php')
);

echo $runner->buildConfig(...$changedFiles) . PHP_EOL;

```

**3. Config**
-------------

[](#3-config)

Returned config should be used to run tests.

Internal doc
============

[](#internal-doc)

How to run Unit tests
---------------------

[](#how-to-run-unit-tests)

`vendor/bin/phpunit --bootstrap bootstrap.php tests/Unit`

### How to run Integration tests

[](#how-to-run-integration-tests)

`vendor/bin/phpunit --bootstrap bootstrap.php tests/Integration`

**4. Parallel Runner**
----------------------

[](#4-parallel-runner)

Multi-threading for testSpy runner. There is a way to configure how many threads to run and how many tests per execution.

Config:
-------

[](#config)

`src/Parallel/Config/Resources/Config.yml`

How to Run:
-----------

[](#how-to-run)

`./parallel.php refresh` - default configuration `./parallel.php 2 10` Optional configuration. Usage: refresh \[\] \[\]

Lock
----

[](#lock)

It allows to run only one runner at time. In case something goes wrong, you need to release a lock manually: `rm pathfrom_config/testSpy-sync-run-lock`

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/39dba2f3282356d0e40a2f8162119155a1f403be73c139637e4ded056da1daa2?d=identicon)[smytsyk](/maintainers/smytsyk)

### Embed Badge

![Health badge](/badges/smytsyk-dev-testspy/health.svg)

```
[![Health](https://phpackages.com/badges/smytsyk-dev-testspy/health.svg)](https://phpackages.com/packages/smytsyk-dev-testspy)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M678](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M753](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M571](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)

PHPackages © 2026

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