awesome-repositories.com
Blog
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
phpspec avatar

phpspec/prophecy

0
View on GitHub↗
8,480 Stars·247 Forks·PHP·MIT·5 Aufrufe

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.

Star-Verlauf

Star-Verlauf für phpspec/prophecyStar-Verlauf für phpspec/prophecy

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Häufig gestellte Fragen

Was macht 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.

Was sind die Hauptfunktionen von phpspec/prophecy?

Die Hauptfunktionen von phpspec/prophecy sind: PHP Testing Frameworks, Test Double Implementations, Method Interception Proxies, Interaction Expectations, Mocking Frameworks, Object Interaction Verification, Dynamic Mock Objects, Test Double Libraries.

Welche Open-Source-Alternativen gibt es zu phpspec/prophecy?

Open-Source-Alternativen zu phpspec/prophecy sind unter anderem: 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…

Open-Source-Alternativen zu Prophecy

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Prophecy.
  • mockery/mockeryAvatar von mockery

    mockery/mockery

    10,724Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗10,724
  • sebastianbergmann/phpunit-mock-objectsAvatar von sebastianbergmann

    sebastianbergmann/phpunit-mock-objects

    4,934Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗4,934
  • rspec/rspec-mocksAvatar von rspec

    rspec/rspec-mocks

    1,148Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗1,148
  • sinonjs/sinonAvatar von sinonjs

    sinonjs/sinon

    9,753Auf GitHub ansehen↗

    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
    Auf GitHub ansehen↗9,753
  • Alle 30 Alternativen zu Prophecy anzeigen→