PHPackages                             shockedplot7560/unit-test - 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. shockedplot7560/unit-test

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

shockedplot7560/unit-test
=========================

Integration testing framework for PocketMine-MP

1.2.11(1y ago)83.7k[1 issues](https://github.com/ShockedPlot7560/PmmpUnit/issues)[8 PRs](https://github.com/ShockedPlot7560/PmmpUnit/pulls)PHPPHP ^8.1 || ^8.2

Since Sep 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ShockedPlot7560/PmmpUnit)[ Packagist](https://packagist.org/packages/shockedplot7560/unit-test)[ RSS](/packages/shockedplot7560-unit-test/feed)WikiDiscussions stable Synced yesterday

READMEChangelog (10)Dependencies (8)Versions (34)Used By (0)

PmIntegration - Integration Testing Framework for PocketMine
------------------------------------------------------------

[](#pmintegration---integration-testing-framework-for-pocketmine)

**Run only on Unix (Linux, Mac)**

This plugin has been created with the sole aim of making integration and functional tests possible during the pocketmine runtime.

It can be used to correctly test the expected result of a command executed by a fake player, interaction with events and multi-threading support.

Tests are run asynchronously using promises to enable support with different systems in place. The libraries used for the promises are : [ReactPHP/promise](https://github.com/reactphp/promise)

Warning

This plugin should not be used in production, as it will shutdown the server as soon as testing is complete.

Installation
------------

[](#installation)

Using of official docker image is strongly recommended.

Mount your tests in `/data/plugin_data/PmmpUnit/tests/` and copy your plugin in `/plugins/`.

Exemple:

```
docker run -it --rm \
  -v /tests/pmmpunit/suitetest/normal/tests:/data/plugin_data/PmmpUnit/tests/ \
  # -v /path/to/plugin:/plugins/ \
  --name pmunit-test \
  ghcr.io/shockedplot7560/pmmpunit/tests-runner:latest
```

Note

An action to simplify the execution of integration tests in a github workflow should be available soon.

Utilisation
-----------

[](#utilisation)

Tests are retrieved from the folder: `plugin_data/PmmpUnit/tests/` and are executed when the server start.

All test classes must inherit from `ShockedPlot7560\PmmpUnit\framework\TestCase`.
All test methods must be prefixed with `test` and must not have any parameters, it must return a `PromiseInterface`.
If the code is executed synchronously and does not have to wait for a result, use `resolve(null)`. Use `Deferred` instead for asynchronous code and `$deferred->resolve(null)` to resolve the promise.

Each test class can execute code when the server is `onLoad`, `onEnable` or `onDisable`. Simply use the corresponding classes.

`setUp` and `tearDown` are called when each class test is run, respectively before and after the test, whatever the result.

> For exemple tests, look at `tests/pmmpunit/suitetest/*/tests`

### TestPlayer utilisation

[](#testplayer-utilisation)

To retrieve one player during a test, call `getPlayer()`.
To test player commands or behavior, create your promise/listener before executing the action. Return the promise in the test method.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance46

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 84.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 ~28 days

Recently: every ~88 days

Total

24

Last Release

373d ago

Major Versions

0.0.1-BETA4 → 1.0.02023-09-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66992287?v=4)[ShockedPlot7560 ](/maintainers/ShockedPlot7560)[@ShockedPlot7560](https://github.com/ShockedPlot7560)

---

Top Contributors

[![ShockedPlot7560](https://avatars.githubusercontent.com/u/66992287?v=4)](https://github.com/ShockedPlot7560 "ShockedPlot7560 (102 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")

---

Tags

developer-toolsdevelopmentintegration-testingpocketmine

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shockedplot7560-unit-test/health.svg)

```
[![Health](https://phpackages.com/badges/shockedplot7560-unit-test/health.svg)](https://phpackages.com/packages/shockedplot7560-unit-test)
```

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.4k](/packages/infection-infection)[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9224.3M28](/packages/phparkitect-phparkitect)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[driftingly/rector-laravel

Rector upgrades rules for Laravel Framework

1.2k15.4M728](/packages/driftingly-rector-laravel)[symplify/phpstan-rules

Set of Symplify rules, type extensions and error formatter for PHPStan

26812.7M333](/packages/symplify-phpstan-rules)

PHPackages © 2026

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