PHPackages                             qratorlabs/smocky-phpunit - 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. qratorlabs/smocky-phpunit

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

qratorlabs/smocky-phpunit
=========================

Extension to wire up Smocky and PHPUnit

2.2.1(4mo ago)02.9k↑407.7%[1 PRs](https://github.com/QratorLabs/Smocky-PHPUnit/pulls)MITPHPPHP ^8.4CI passing

Since Mar 20Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/QratorLabs/Smocky-PHPUnit)[ Packagist](https://packagist.org/packages/qratorlabs/smocky-phpunit)[ Docs](https://github.com/QratorLabs/Smocky-PHPUnit)[ RSS](/packages/qratorlabs-smocky-phpunit/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (5)Versions (17)Used By (0)

QratorLabs\\Smocky-PHPUnit
==========================

[](#qratorlabssmocky-phpunit)

This is a helper library-helper for QratorLabs\\Smocky that allows you to use Smocky and PHPUnit together with less boilerplate code.

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

[](#installation)

```
composer require --dev "qratorlabs/smocky-phpunit:^1.0||^2.0"
```

Versioning
----------

[](#versioning)

This library follows [SemVer](https://semver.org/). But major versions are used to indicate compatibility with PHPUnit versions:

- `1.x` is compatible with PHPUnit 9.6...12.0.8
- `2.0` is compatible with PHPUnit 12.0.9...12.4.x
- `2.1` is compatible with PHPUnit 12.5.0...
- `2.2` is compatible with PHPUnit 13.0.0...

Usage
-----

[](#usage)

To use with PHPUnit:

- `MockedMethod` to mock method "globally" and use PHPUnit's `*Mockers` - `expects/willReturn/willReturnCallback/...`
- `MockedFunction`

MockedMethod
------------

[](#mockedmethod)

The main target is to make mocking static methods easy and feels-n-looks like using PHPUnit.

```
public function testSomeTest(): void {
    $methodMock = new MockedMethod($this, SomeClass::class, 'someMethod', once());
    $methodMock->getMocker()->willReturn(10);

    SomeClass::someMethod(); // will return `10`

    SomeClass::someMethod(); // will cause error (expectation - one call)
}
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance82

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~23 days

Recently: every ~16 days

Total

15

Last Release

142d ago

Major Versions

1.0.0 → 2.0.02025-03-20

1.0.2 → 2.0.32025-03-21

v1.x-dev → v2.0.x-dev2025-12-10

PHP version history (2 changes)2.0.0PHP ^8.0

2.2.1PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4123596?v=4)[Ilia Urvachev](/maintainers/rtm-ctrlz)[@rtm-ctrlz](https://github.com/rtm-ctrlz)

---

Top Contributors

[![rtm-ctrlz](https://avatars.githubusercontent.com/u/4123596?v=4)](https://github.com/rtm-ctrlz "rtm-ctrlz (23 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/qratorlabs-smocky-phpunit/health.svg)

```
[![Health](https://phpackages.com/badges/qratorlabs-smocky-phpunit/health.svg)](https://phpackages.com/packages/qratorlabs-smocky-phpunit)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30314.4k7](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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