awesome-repositories.com
المدونة
MCP
awesome-repositories.com

اكتشف أفضل مستودعات المصادر المفتوحة باستخدام بحث مدعوم بالذكاء الاصطناعي.

استكشفعمليات بحث منسقةبدائل مفتوحة المصدربرمجيات ذاتية الاستضافةالمدونةخريطة الموقع
المشروعحولكيفية ترتيب النتائجالصحافةخادم MCP
قانونيالخصوصيةالشروط
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
mockery avatar

mockery/mockery

0
View on GitHub↗
10,724 نجوم·465 تفرعات·PHP·BSD-3-Clause·8 مشاهداتdocs.mockery.io/en/stable↗

Mockery

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 interface for defining intricate expectations, including call frequency constraints, execution order control, and custom argument validation. Additionally, it supports partial mocking, which allows test doubles to selectively execute original class logic while overriding specific methods to isolate units of code within legacy systems.

Beyond core mocking, the library offers comprehensive tools for interaction verification, enabling the recording of method invocations for post-execution inspection. It integrates directly with standard test runners to automate the lifecycle management of mock objects, including setup, teardown, and the verification of expectations. Global configuration settings allow for standardized error reporting and behavior across entire test suites.

Features

  • Dependency Mocking - Provides a comprehensive framework for replacing class dependencies with mock objects to isolate units of code during testing.
  • Mocking Frameworks - Provides a framework for defining expectations, return values, and interaction patterns for test doubles.
  • Interaction Verification Utilities - Records and asserts method calls, argument patterns, and execution sequences to ensure components interact correctly.
  • Unit Testing Frameworks - Creates simulated objects to replace real dependencies, allowing developers to test individual classes in isolation.
  • Static and Instantiation Interceptors - Replaces hard-coded object creation and static calls with mock instances to control internal dependencies.
  • Test Suite Integrations - Connects mock lifecycles with testing frameworks to automate setup, teardown, and validation of expectations.
  • Interaction Spies - Captures method invocation history on mock objects to enable post-execution verification of behavior.
  • Testing and Quality - Mock object library for testing.
  • Mock Expectation Definitions - Configures mock objects to anticipate specific method calls and return sequences.
  • Fluent Interfaces - Provides a chainable interface for defining complex method constraints, return values, and call counts during test setup.
  • Mock Interaction Recorders - Captures method calls made to a mock object to enable post-execution inspection.
  • Legacy Code Isolation Tools - Isolates specific logic by creating partial mocks or intercepting hard-coded dependencies to test complex systems.
  • Test Lifecycle Integrations - Hooks into standard test runner teardown phases to automatically verify expectations and clean up mock object state.
  • Partial Mocks - Allows test doubles to selectively execute original class logic while overriding specific methods to isolate units of code.
  • Protected Method Mocks - Allows defining expectations on protected class methods to handle scenarios where public interfaces are insufficient for isolation.
  • Partial Mocking Utilities - Configures test doubles to execute real code for some methods while stubbing others to isolate specific logic.
  • Mocking Observability Tools - Reports specific errors and provides detailed exception objects when expectations are violated during test execution.
  • Method Return Values - Specifies the output of mocked methods by defining static values or sequential return sequences.
  • Argument Constraint Matchers - Evaluates method parameters against custom logic or type patterns to validate interaction data during execution.
  • Method Call Verification - Records method calls to test doubles for verification after the code under test has finished executing.
  • Method Call Frequency Constraints - Enforces constraints on method invocation counts to ensure correct interaction patterns.
  • Constructor Bypassing - Provides mechanisms to instantiate objects without executing constructors to avoid side effects during test setup.
  • Lifecycle Management - Ensures mock containers are properly closed and expectations are verified automatically during the test teardown phase.
  • Method Stubbing Utilities - Sets baseline expectations for mock objects that remain active unless selectively overridden.
  • Reflection-Based Proxies - Generates mock objects at runtime by inspecting class signatures and creating dynamic proxies that intercept method calls.
  • Global Mocking Settings - Provides global settings to adjust default object creation, verification strictness, and error handling.
  • Dynamic - Enables the creation of test doubles that implement specific traits on the fly to satisfy interface requirements during unit testing.
  • Magic Method Interceptors - Simulates magic method behavior by intercepting calls to virtual methods and properties during testing.
  • Exception Simulation Utilities - Configures mock objects to throw specific exceptions to verify failure handling.
  • Static Method Aliases - Replaces class names with mock aliases at runtime to intercept static calls and object instantiations.
  • Test Argument Validators - Provides mechanisms to validate arguments passed to mock objects during test execution.
  • Interaction Sequence Orderers - Allows specification of required method call sequences to ensure correct interaction order.

سجل النجوم

مخطط تاريخ النجوم لـ mockery/mockeryمخطط تاريخ النجوم لـ mockery/mockery

بحث بالذكاء الاصطناعي

استكشف المزيد من المستودعات الرائعة

صف ما تحتاجه بلغة بسيطة — وسيقوم الذكاء الاصطناعي بترتيب آلاف المشاريع مفتوحة المصدر المنسقة حسب الصلة.

Start searching with AI

بدائل مفتوحة المصدر لـ Mockery

مشاريع مفتوحة المصدر مشابهة، مرتبة حسب عدد الميزات المشتركة مع Mockery.
  • mockito/mockitoالصورة الرمزية لـ mockito

    mockito/mockito

    15,432عرض على GitHub↗

    Mockito is a Java mocking framework and JUnit testing library used to create simulated objects and stub method calls to isolate components during unit tests. It functions as a dynamic proxy generator and bytecode instrumentation tool, allowing for the creation of runtime substitutes that mimic the behavior of real classes. The framework distinguishes itself by providing the ability to mock final classes and methods, bypassing standard language restrictions through bytecode modification. This capability enables the testing of legacy code that lacks interfaces. The toolset covers behavioral mo

    Java
    عرض على GitHub↗15,432
  • phpspec/prophecyالصورة الرمزية لـ phpspec

    phpspec/prophecy

    8,480عرض على GitHub↗

    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, interactio

    PHP
    عرض على GitHub↗8,480
  • thomhurst/tunitالصورة الرمزية لـ thomhurst

    thomhurst/TUnit

    3,744عرض على GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    عرض على GitHub↗3,744
  • rspec/rspec-mocksالصورة الرمزية لـ rspec

    rspec/rspec-mocks

    1,148عرض على 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
    عرض على GitHub↗1,148
عرض جميع البدائل الـ 30 لـ Mockery→

الأسئلة الشائعة

ما هي وظيفة mockery/mockery؟

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.

ما هي الميزات الرئيسية لـ mockery/mockery؟

الميزات الرئيسية لـ mockery/mockery هي: Dependency Mocking, Mocking Frameworks, Interaction Verification Utilities, Unit Testing Frameworks, Static and Instantiation Interceptors, Test Suite Integrations, Interaction Spies, Testing and Quality.

ما هي البدائل مفتوحة المصدر لـ mockery/mockery؟

تشمل البدائل مفتوحة المصدر لـ mockery/mockery: mockito/mockito — Mockito is a Java mocking framework and JUnit testing library used to create simulated objects and stub method calls… phpspec/prophecy — Prophecy is a PHP mocking framework and test double library used to simulate object dependencies during unit testing.… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… 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… vitest-dev/vitest — Vitest is a high-performance testing framework designed for JavaScript and TypeScript applications. It provides an…