SkillAgentSearch skills...

Phony

Mocks, stubs, and spies for PHP.

Install / Use

/learn @eloquent/Phony
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

No longer maintained

This package is no longer maintained. See this statement for more info.

<p align="center"><img alt="Phony" src="assets/readme/phony-logo-with-text.svg" width="400" /></p>

Mocks, stubs, and spies for PHP.

Current version image

Example verification output

Installation

Available as various Composer packages, depending on the test framework in use:

  • For [Kahlan], use [eloquent/phony-kahlan] and import Eloquent\Phony\Kahlan.
  • For [PHPUnit], use [eloquent/phony-phpunit] and import Eloquent\Phony\Phpunit.
  • For [Peridot], use [eloquent/phony-peridot] and import Eloquent\Phony.
  • For other frameworks, or standalone usage, use [eloquent/phony] and import Eloquent\Phony.

See the section on Integration with test frameworks in the [documentation].

Documentation

Full [documentation] is available.

What is Phony?

Phony is a PHP library for creating various kinds of test doubles, including object mocks, function stubs, and function spies.

Why use Phony?

Support for language features, old and new

Phony is committed to supporting new PHP features as they emerge. Features that require workarounds in other mocking frameworks (such as passed-by-reference arguments), typically "just work" with Phony.

Amongst other features, Phony supports:

Zero-configuration integrations

Integrating Phony with your favorite test framework is as simple as choosing the correct namespace to import. Complimentary features make integrations seamless and intuitive:

Interested in better integration with other test frameworks? So are we! Just open a [GitHub issue] if there's something we can do.

Refined verification output

Phony has received a great deal of work and refinement where the rubber meets the road; in its verification output:

Example verification output

Phony's output includes succinct but detailed information that is focused on helping you find the cause of the failure as fast as possible. Where appropriate, the output uses difference comparison and color to further highlight important details.

First-class support for functions and callbacks

Phony is designed to provide support for testing both object-based, and function-based systems. In Phony, object mocks are built upon full-featured function level stubs and spies.

This focus on support for procedural programming allows Phony to handle many situations that cannot be handled by solely class-based mocking frameworks. Since Phony's class-level support is based upon its function-level support, the interfaces are consistent, and require very little extra knowledge to use.

Extensive feature set

Phony has an extensive and powerful feature set. For detailed information on a particular feature, select one of the following:

Related Skills

View on GitHub
GitHub Stars195
CategoryDevelopment
Updated1mo ago
Forks7

Languages

PHP

Security Score

100/100

Audited on Feb 13, 2026

No findings