Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phiremock Client Laravel Package

mcustiel/phiremock-client

PHP client for Phiremock Server with a fluent API to define HTTP expectations, manage scenarios, and reset server state. Works with Guzzle 6 by default, or any PSR-18 HTTP client by overriding the factory for custom connections.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test Automation & Mocking Infrastructure: Enables programmatic control over HTTP mocks (e.g., API testing, CI/CD pipelines) with a fluent, Laravel-friendly API, reducing reliance on manual mock setups or brittle test doubles.
  • Scenario-Driven Testing: Supports complex workflows (e.g., multi-step API sequences, error handling) via scenario states and priority-based expectations, critical for B2B integrations or payment systems.
  • Build vs. Buy: Avoids reinventing a mock server client while offering customization (PSR-18 HTTP clients, HTTPS support). Ideal for teams already using Phiremock Server or evaluating mocking tools.
  • Roadmap for API Testing: Validates investment in Phiremock Server (paired with this client) as a long-term solution for contract testing, reducing dependency on third-party services (e.g., Postman, Mockoon).
  • Local Development: Speeds up feature development by mocking external APIs (e.g., payment gateways, analytics) without network calls, improving iteration speed.

When to Consider This Package

Adopt if:

  • Your team uses Phiremock Server (or is evaluating it) for HTTP mocking in PHP/Laravel projects.
  • You need programmatic control over mocks (e.g., dynamic expectations, scenario management) from tests or CI/CD.
  • Your workflow involves complex API interactions (e.g., OAuth flows, retries, conditional responses) that require stateful mocks.
  • You’re on PHP 8.2+ (Laravel 10+) and want to leverage JSON Path for advanced response validation/transformation.
  • You prioritize developer experience: The fluent API reduces boilerplate compared to raw HTTP requests or JSON config files.

Look elsewhere if:

  • You’re not using Phiremock Server: This client is tightly coupled to Phiremock’s API; alternatives like WireMock (Java) or Mockoon (GUI) may fit better.
  • Your mocking needs are simple: For basic stubs, Laravel’s Http::fake() or Mockery may suffice.
  • You’re on PHP <8.2: Downgrade to v1.x, but lose JSON Path and modern PHP features.
  • Your team prefers GUI tools: If developers resist CLI/config-driven mocks, consider Postman Mock Servers or Stoplight.
  • You need active maintenance: The package has low stars (16) and no dependents; evaluate risk tolerance.

How to Pitch It (Stakeholders)

For Executives: "This package lets our Laravel team programmatically control HTTP mocks—critical for fast, reliable API testing and local development. By integrating with Phiremock Server, we avoid vendor lock-in while gaining scenario-driven testing (e.g., simulating payment failures, multi-step workflows). The JSON Path support (v2.0+) unlocks advanced data validation, reducing bugs in integrations. Low risk: Open-source, PHP 8.2+ aligned with Laravel 10+, and future-proofs our test infrastructure."

For Engineering: *"Phiremock Client gives us a Laravel-native way to manage mocks in tests/CI. Key wins:

  • Fluent API: Define expectations in clean PHP (e.g., respond(418)->andBody('Teapot')) instead of JSON/YAML.
  • Scenarios: Model complex flows (e.g., setScenarioState('checkout', 'payment_failed')).
  • JSON Path: Query nested responses (e.g., $response->jsonPath('$.data.user.id')) for dynamic assertions.
  • PSR-18: Swap HTTP clients (e.g., Guzzle v7) if needed. Action: Pilot in API test suites or feature branches—start with listExecutions() to debug mock traffic. Blockers: PHP 8.2+ required; pair with Phiremock Server."*

For QA/Test Teams: *"This replaces manual mock setups (e.g., Postman) with code-driven mocks that:

  • Sync with tests: Expectations live in your repo, not spreadsheets.
  • Support edge cases: Simulate rate limits, timeouts, or conditional responses.
  • Integrate with CI: Reset mocks between test runs ($client->reset()). Example: Test a payment API’s retry logic by defining a scenario with priority(5) and respond(429). Try it: Use the helper functions (e.g., on(getRequest('/api/pay'))->then(respond(200))) to mock a single endpoint."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky