awesome-repositories.com
Blog
MCP
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoAcerca deCómo clasificamosPrensaServidor MCP
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
phpspec avatar

phpspec/prophecy

0
View on GitHub↗
8,480 estrellas·247 forks·PHP·MIT·7 vistas

Prophecy

Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing. It serves as a behavioral testing tool for creating mocks, stubs, and dummies to isolate code and ensure predictable test results.

The framework enables interaction verification by tracking method call counts and arguments to validate that specific interactions occurred. It supports defining specific return values or custom logic for method calls to simulate various execution scenarios.

The library provides capabilities for argument matching based on type or value, interaction spying to record calls, and the generation of lightweight dummy objects that satisfy interface type hints.

Features

  • PHP Testing Frameworks - Provides a specialized mocking and test double framework designed specifically for the PHP ecosystem.
  • Test Double Implementations - Provides controlled substitutes for real objects, including mocks, stubs, and spies, to isolate code during testing.
  • Method Interception Proxies - Implements a dynamic proxy system to intercept method calls and inject custom behavioral logic without altering source code.
  • Interaction Expectations - Tracks call counts and arguments to validate that specific object interactions occurred as required by the test.
  • Mocking Frameworks - Provides a complete framework for creating simulated objects and stubbing method calls to isolate PHP components.
  • Object Interaction Verification - Verifies that specific methods on an object are called with expected arguments to validate internal logic.
  • Dynamic Mock Objects - Provides runtime generation of proxy objects to simulate dependencies and track interactions during unit tests.
  • Test Double Libraries - Generates mock, dummy, and spy objects to isolate code and ensure predictable results during PHP testing.
  • Dummy Implementations - Generates minimal object instances that satisfy type hints by returning null for every method defined in an interface.
  • Argument Constraint Matchers - Provides logic for validating method parameters against custom predicates, types, or patterns during mock interaction.
  • Test Argument Validators - Includes routines for validating arguments passed to mock objects using types, values, or custom callbacks.
  • Method Call Frequency Constraints - Enforces specific limits on the number of times a method is invoked during test execution.
  • Dummy Object Generation - Generates lightweight token objects that implement specific interfaces and return null for all method calls.
  • Method Stubbing Utilities - Provides mechanisms to define specific return values or custom logic for mock method calls.
  • Interface Stubbing - Generates lightweight objects that implement required interfaces to satisfy type hints without implementing full business logic.
  • Interaction Spies - Provides utilities for capturing method invocation history on mock objects for post-execution verification.
  • Reflection-Based Proxies - Inspects class signatures at runtime via reflection to generate compatible proxy objects for mocking.
  • Testing and Quality - Opinionated mocking framework.

Historial de estrellas

Gráfico del historial de estrellas de phpspec/prophecyGráfico del historial de estrellas de phpspec/prophecy

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Alternativas open-source a Prophecy

Proyectos open-source similares, clasificados según cuántas características comparten con Prophecy.
  • mockery/mockeryAvatar de mockery

    mockery/mockery

    10,724Ver en GitHub↗

    Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing. It serves as a utility for simulating class behavior, intercepting method calls, and validating arguments, allowing developers to replace real dependencies with mock objects to verify that code components interact as intended. The framework distinguishes itself through advanced capabilities for handling complex testing scenarios, such as bypassing constructors, mocking protected methods, and intercepting static calls or internal object instantiations. It provides a fluent inter

    PHPmockmockerymocking
    Ver en GitHub↗10,724
  • sebastianbergmann/phpunit-mock-objectsAvatar de sebastianbergmann

    sebastianbergmann/phpunit-mock-objects

    4,934Ver en GitHub↗

    This project is a mocking framework and library designed for creating simulated objects to isolate code and verify interactions during PHPUnit testing. It serves as a toolset for writing and running automated tests in PHP to ensure software correctness. The library replaces real object dependencies with controlled doubles to test specific code paths and simulate complex class behaviors. This enables the verification of logic within individual PHP classes by mocking the inputs and outputs of their collaborators. The framework provides capabilities for runtime object synthesis and interception

    PHP
    Ver en GitHub↗4,934
  • rspec/rspec-mocksAvatar de rspec

    rspec/rspec-mocks

    1,148Ver en GitHub↗

    This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It functions as a comprehensive mocking framework that allows developers to replace real objects with controlled placeholders, ensuring that code interacts with its dependencies as expected during automated test execution. The framework distinguishes itself through its ability to perform partial double verification, which checks that stubbed methods exist on the underlying object to prevent tests from passing against incorrect interfaces. It also provides sophisticated constant man

    Rubyrspecruby
    Ver en GitHub↗1,148
  • sinonjs/sinonAvatar de sinonjs

    sinonjs/sinon

    9,753Ver en GitHub↗

    Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes. The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between tes

    JavaScript
    Ver en GitHub↗9,753
Ver las 30 alternativas a Prophecy→

Preguntas frecuentes

¿Qué hace phpspec/prophecy?

Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing. It serves as a behavioral testing tool for creating mocks, stubs, and dummies to isolate code and ensure predictable test results.

¿Cuáles son las características principales de phpspec/prophecy?

Las características principales de phpspec/prophecy son: PHP Testing Frameworks, Test Double Implementations, Method Interception Proxies, Interaction Expectations, Mocking Frameworks, Object Interaction Verification, Dynamic Mock Objects, Test Double Libraries.

¿Qué alternativas de código abierto existen para phpspec/prophecy?

Las alternativas de código abierto para phpspec/prophecy incluyen: mockery/mockery — Mockery is a PHP framework designed for creating test doubles, stubs, and spies to facilitate isolated unit testing.… sebastianbergmann/phpunit-mock-objects — This project is a mocking framework and library designed for creating simulated objects to isolate code and verify… rspec/rspec-mocks — This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It… sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… moq/moq4 — Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It… mockito/mockito — Mockito is a Java mocking framework and JUnit testing library used to create simulated objects and stub method calls…