PHPackages                             pccomponentes/ddd-testing - 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. pccomponentes/ddd-testing

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

pccomponentes/ddd-testing
=========================

Added test utils to ddd mini framework

v1.0.2(5y ago)027.7k2[1 PRs](https://github.com/PcComponentes/ddd-testing/pulls)MITPHPCI failing

Since May 25Pushed 5y ago5 watchersCompare

[ Source](https://github.com/PcComponentes/ddd-testing)[ Packagist](https://packagist.org/packages/pccomponentes/ddd-testing)[ RSS](/packages/pccomponentes-ddd-testing/feed)WikiDiscussions master Synced 5d ago

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

DDD Testing
===========

[](#ddd-testing)

Tools for helping in test development.

PcComponentes\\Ddd\\Testing\\Util\\PhpUnit\\IterableMockTrait
-------------------------------------------------------------

[](#pccomponentesdddtestingutilphpunititerablemocktrait)

Allows you to introduce mocks in tested method through an iterable mock object in an easy way.

### Use

[](#use)

Example:

```
use PcComponentes\Ddd\Testing\Util\PhpUnit\IterableMockTrait;
use PHPUnit\Framework\TestCase;

final class Testing extends TestCase
{
    use IterableMockTrait;

    public function testMethod()
    {
        $mockedItem1 = $this->createMock(\stdClass::class);
        // Assertions in mock
        $mockedItem2 = $this->createMock(\stdClass::class);
        // Assertions in mock

        $mockedIterator = $this->addIterableValuesToMock(
            $this->createMock(\Iterator::class), // Your iterable mock
            [
                $mockedItem1,
                $mockedItem2,
            ],
        );
        // ...
    }
}
```

PcComponentes\\Ddd\\Testing\\Util\\PhpUnit\\SerializableMockTrait
-----------------------------------------------------------------

[](#pccomponentesdddtestingutilphpunitserializablemocktrait)

Allows you to simplify the serializable parametrization of a \\JsonSerializable mock, making the code more semantic and easy to read.

### Use

[](#use-1)

Example:

```
use PcComponentes\Ddd\Testing\Util\PhpUnit\SerializableMockTrait;
use PHPUnit\Framework\TestCase;

final class Testing extends TestCase
{
    use SerializableMockTrait;

    public function testMethod()
    {
        $valueToReturnOnSerialize = 'some compatible with serialization method declared';

        $serializableMock = $this->addJsonSerializationToMock(
            $this->createMock(\JsonSerializable::class), // Your mock which implements jsonSerialize method
            $this->once(), // Or other InvocationOrder
            $valueToReturnOnSerialize,
        );
        // ...
    }
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~153 days

Total

3

Last Release

1875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c4eb3322c15a9344e9c086a7de11c3204bf5aab5321b562bf9193f5ee8cd420?d=identicon)[zoilomora](/maintainers/zoilomora)

---

Top Contributors

[![sergiohm](https://avatars.githubusercontent.com/u/6035365?v=4)](https://github.com/sergiohm "sergiohm (6 commits)")[![calmohallag](https://avatars.githubusercontent.com/u/34070946?v=4)](https://github.com/calmohallag "calmohallag (3 commits)")[![PhiSYS](https://avatars.githubusercontent.com/u/1719325?v=4)](https://github.com/PhiSYS "PhiSYS (1 commits)")

### Embed Badge

![Health badge](/badges/pccomponentes-ddd-testing/health.svg)

```
[![Health](https://phpackages.com/badges/pccomponentes-ddd-testing/health.svg)](https://phpackages.com/packages/pccomponentes-ddd-testing)
```

###  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)
