Search by

friendsofmago / mago-mockery

alfredbez

Mockery support for the Mago static analyzer.

Package info

github.com/FriendsOfMago/mago-mockery

pkg:composer/friendsofmago/mago-mockery

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-12-03 14:10 UTC

This package is auto-updated.

Last update: 2026-12-03 14:39:10 UTC


README

ci CodSpeed Packagist version Packagist downloads PHP Mago Mockery License

Mockery 1.6 static analysis extension for Mago. It types mocks as the mocked class intersected with Mockery\MockInterface, so mago analyze checks calls on a mock like calls on the real class.

Read the full documentation at friendsofmago.github.io/mago-mockery.

Install

You need PHP 8.1 or newer, Mago ^1.60.2, and Mockery ^1.6.

composer require --dev friendsofmago/mago-mockery

Register Mockery's library path and the bundled worker in mago.toml:

[source]
includes = ["vendor/mockery/mockery/library"]

[extension-hosts.mockery]
command = ["php", "-d", "xdebug.mode=off", "-d", "pcov.enabled=0", "-d", "memory_limit=512M", "vendor/bin/mago-mockery-worker"]
workers = 1
# Optional. Default is off. Set to "1" to report unknown mocked method names.
# environment = { MAGO_MOCKERY_STRICT_METHODS = "1" }

Validate the worker and run the analyzer:

vendor/bin/mago extension validate
vendor/bin/mago analyze

Documentation

License

MIT. See LICENSE.