PHPackages                             ssaweb/phpunit-slot - 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. ssaweb/phpunit-slot

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

ssaweb/phpunit-slot
===================

A package to help you catch method parameters for testing.

v1.1.0(2y ago)0678MITPHP

Since Jun 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ssa-web-solutions/phpunit-slot)[ Packagist](https://packagist.org/packages/ssaweb/phpunit-slot)[ RSS](/packages/ssaweb-phpunit-slot/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

phpunit-slot
============

[](#phpunit-slot)

A feature that allows you to capture method parameters as you would do with Mockk capture() -

Well, I just created this package to make parameter assertions more readable (my personal thought).

Of course you can say doing the way below already work, but I dunno when there's a need to add a callback for each parameter it didn't look well to me.

That's why I decided to create this package and make this more the way I was used to in Kotlin (with the [mockk](https://mockk.io/#capturing) library =)

```
$mock
    ->expects($this->once())
    ->method('foo')
    ->with(self::callback(function ($value): bool {
        self::assertEquals('value', $value);
        return true;
    }))
```

Instead of that I am doing something like this

```
$slot = new Slot();

$mock
    ->expects($this->once())
    ->method('foo')
    ->with($slot->capture())

//other mock declarations

//then
self::assertEquals(1, $slot->captured);
```

v1.1.0+ It now supports multiple method calls. So, if your method is being called more than once, the captured value will be an array of each capture value.

```
$slot = new Slot();

$mock
    ->expects($this->any())
    ->method('foo')
    ->with($slot->capture())

//other mock declarations

//then
self::assertEquals(1, $slot->captured[0]);
self::assertEquals(2, $slot->captured[1]);
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~252 days

Total

2

Last Release

848d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cac6ff1f52ea078adb7daf8bef160f59cb0661a6cb26dc2341e53653a083a339?d=identicon)[lucasctd](/maintainers/lucasctd)

---

Top Contributors

[![lucasctd](https://avatars.githubusercontent.com/u/5876679?v=4)](https://github.com/lucasctd "lucasctd (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ssaweb-phpunit-slot/health.svg)

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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