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

Abandoned → [pccomponentes/ddd-testing](/?search=pccomponentes%2Fddd-testing)Library[Testing &amp; Quality](/categories/testing)

dosfarma/ddd-testing
====================

Added test utils to ddd mini framework

1.0.1(5y ago)019MITPHP

Since May 25Pushed 5y agoCompare

[ Source](https://github.com/DosFarma/ddd-testing)[ Packagist](https://packagist.org/packages/dosfarma/ddd-testing)[ RSS](/packages/dosfarma-ddd-testing/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (3)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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~288 days

Total

2

Last Release

1896d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1719325?v=4)[David Strencsev](/maintainers/PhiSYS)[@PhiSYS](https://github.com/PhiSYS)

---

Top Contributors

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

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/dosfarma-ddd-testing/health.svg)](https://phpackages.com/packages/dosfarma-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)
