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 Server Laravel Package

mcustiel/phiremock-server

PHP HTTP mock/stub server inspired by WireMock. Mock requests by method/headers/URL/body/forms, set responses via REST API, support scenarios, priorities, latency simulation, verification counts, proxying, and loading expectations from JSON files.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerate API/Service Development: Enables rapid prototyping and testing of HTTP-dependent features by mocking external services (e.g., payment gateways, third-party APIs) without waiting for backend teams or relying on unstable live endpoints.
  • Shift-Left Testing: Integrates seamlessly with Codeception (via extensions) to enable contract testing and unit/integration tests for HTTP interactions, reducing flaky tests caused by external dependencies.
  • Performance & Latency Testing: Simulates network delays (e.g., delayMillis) to test how applications handle slow responses, critical for SLA compliance or user experience roadmaps.
  • Build vs. Buy: Avoids maintaining custom mock servers or licensing WireMock (Java-based) for PHP ecosystems, reducing technical debt while providing 90%+ feature parity.
  • Stateful Workflows: Supports scenario-based testing (e.g., multi-step API sequences like OAuth flows, checkout processes) where responses depend on prior interactions.
  • Binary Data Handling: Base64-encoded responses for file uploads/downloads (e.g., PDFs, images) enable testing media-heavy features without actual storage dependencies.
  • Environment Parity: Standardizes mocking across dev/staging/prod-like environments via config overrides, ensuring consistency in behavior across pipelines.

When to Consider This Package

  • Avoid if:
    • Your team uses Java/Kotlin and prefers WireMock (mature, enterprise-grade).
    • You need graphQL mocking (this package is HTTP/REST-only).
    • Your stack is non-PHP (e.g., Node.js, Python) and integrating a PHP server is prohibitive.
    • You require advanced protocol support (WebSockets, gRPC) beyond HTTP.
  • Look elsewhere if:
    • You need dynamic mock generation from OpenAPI/Swagger specs (consider Mockoon or Postman Mock Servers).
    • Your use case demands real-time collaboration (e.g., shared mocks across teams; tools like Stoplight may fit better).
    • You’re constrained by GPL-3.0 license (e.g., proprietary software; check alternatives like Pragmarx/HTTPMockServer).
  • Consider if:
    • Your PHP app relies on external HTTP services (payments, auth, legacy systems) that are slow/unreliable in tests.
    • You want to reduce CI/CD flakiness caused by external API failures.
    • Your team lacks Java expertise but needs WireMock-like functionality.

How to Pitch It (Stakeholders)

For Executives (Business/Tech Leads)

"Phiremock lets us mock external APIs in PHP—just like WireMock, but without Java dependencies. This means:

  • Faster development: Teams can test features without waiting for backend APIs (e.g., payment processing, third-party integrations).
  • More reliable tests: No more flaky CI builds due to external service outages.
  • Lower costs: Avoids licensing fees for commercial mocking tools.
  • Scalable testing: Supports complex workflows (e.g., multi-step checkout processes) with stateful scenarios. For example, our [Feature X] roadmap item depends on a payment gateway. With Phiremock, QA can test the full flow locally—cutting testing time by 40%—before the gateway is ready."

For Engineers (Dev/Test Teams)

"Phiremock is a drop-in replacement for WireMock in PHP, with these key advantages:

  • Zero Java overhead: Runs natively in your PHP environment (Composer install).
  • REST API for mocks: Define expectations via JSON or code (e.g., POST /__phiremock/expectations).
  • Codeception integration: Plugs into your existing test suite with minimal setup.
  • Advanced features:
    • Simulate network latency (delayMillis) for performance testing.
    • Handle binary responses (e.g., images, PDFs) via base64 encoding.
    • Prioritize expectations to resolve conflicts in mocks.
  • Use cases:
    • Unit tests: Mock a Stripe API call without hitting live endpoints.
    • Contract tests: Verify your app sends the right headers/body to external services.
    • E2E tests: Test a full user flow (e.g., login → checkout) with controlled responses. Setup takes <10 minutes: add to composer.json, configure your app’s dev environment to point to http://localhost:8080, and start mocking."

For PMs (Roadmap/Feature Planning)

"This enables us to:

  • De-risk API-dependent features: Ship prototypes without waiting for third-party integrations.
  • Improve test coverage: Add contract tests for HTTP interactions (e.g., ‘Does our app send the correct Authorization header?’).
  • Reduce onboarding friction: New hires can test locally without external dependencies.
  • Align with ‘shift-left testing’: Catch integration issues earlier in the dev cycle. Example: For our [Feature Y], we can mock the weather API during development, then switch to the real API in staging—no context switching for devs."
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
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