Search by

patrick-maynard / mock-it-all

patrickmaynard

A simple tool that allows developers to automatically generate mock logic for PHPUnit tests

Package info

github.com/patrickmaynard/mock-it-all

Homepage

pkg:composer/patrick-maynard/mock-it-all

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

v0.1.8 2026-08-18 12:39 UTC

This package is auto-updated.

Last update: 2026-08-31 18:13:54 UTC


README

Tool for creating mock dependency chains automatically, letting you focus on the actual tests

How to use

In a pre-existing PHP project do the following to install the tool:

composer require patrick-maynard/mock-it-all

... then run the create-test-stub-with-mocks command as shown below.

(This example creates stub test logic for the included President demo class. It does so only if a folder called tests/Unit already exists.)

php ./vendor/bin/mock-it-all create-test-stub-with-mocks --fqcn="PatrickMaynard\MockItAll\Stubs\President" --test-folder="tests/Unit"

... or if you want to use an interactive wizard to choose a class and path:

php ./vendor/bin/mock-it-all create-test-stub-with-mocks

To get some other options for the CLI command:

php ./vendor/bin/mock-it-all create-test-stub-with-mocks --help

It is recommended that developers install this in development environments, not in test, stage or production environments.