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(3mo ago)02.4k↓33.3%MITPHPPHP ^8.4CI passing

Since Mar 20Pushed 3mo 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 1mo ago

READMEChangelogDependencies (5)Versions (16)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 94% of packages

Maintenance82

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

96d 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

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

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