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 1mo ago

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 27% 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

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

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/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.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/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.1k](/packages/orchestra-testbench)

PHPackages © 2026

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