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

Mock Webserver Laravel Package

donatj/mock-webserver

Lightweight PHP mock web server for tests and local development. Spin up an HTTP server on a random port, enqueue canned responses, inspect received requests, and simulate endpoints reliably. Handy for integration tests without external services.

View on GitHub
Deep Wiki
Context7
v2.10.0

What's Changed

Notice: PHP 7.2 is now the minimum supported version because of a vulnerability with older versions of PHPUnit.

See: CVE-2026-24765 / GHSA-vvj3-c3rp-c85p for more information.

Fixes

  • Bug where if PHP itself was not in the PATH of the running PHP server process, it would fail to start with a message that the port might not be open. This became a major issue with macOS 26.3

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.9.0...v2.10.0

v2.9.0

Fixes

#81 - Nested ResponseByMethod does not work with ResponseStack in sequential requests by @juslintek

What's Changed

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.8.0...v2.9.0

v2.8.0

Minor BC Break

The hashes generated by donatj\MockWebServer\Response::getRef have changed.

While this value was generally for internal use, it was not marked as such so this is a breaking change.

What's Changed

New Contributors

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.7.3...v2.8.0

v2.7.3

What's Changed

Adds phpstan, makes appropriate fixes

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.7.2...v2.7.3

v2.7.2

What's Changed

  • Fixes #67 - Crash on stopping twice - Thanks @cgimenes

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.7.1...v2.7.2

v2.6.3

Backports descriptor fix from v2.7.1 onto the v2.6.x release

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.6.2...v2.6.3

v2.7.1

What's Changed

Fixed an issue with 'files' stream wrappers not being able to handle [file, path, mode] syntax - thanks to @sigma-z

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.7.0...v2.7.1

v2.7.0

What's Changed

Summary

DelayedResponse now implements InitializingResponseInterface to enable support for sub-responses that implement InitializingResponseInterface - Thanks @Jarlakxen

Massively improved test coverage.

PRs

New Contributors

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.6.2...v2.7.0

v2.6.2

Fixes a regression where the path to the server script was not being escaped, causing problems if there was a space anywhere in the path.

What's Changed

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.6.1...v2.6.2

v2.6.1

What's Changed

New Contributors

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.6.0...v2.6.1

v2.6.0
v2.4.1

What's Changed

New Contributors

Full Changelog: https://github.com/donatj/mock-webserver/compare/v2.4.0...v2.4.1

v2.4.0
  • #31 / #33 Configurable Default Route - thanks to @itsjavi
v2.3.0
  • #28 Fix documentation example for Response by Method - thanks to @Aoshido
  • #30 Reduce sleep to make tests more fast - thanks to @vitormattos
  • Other small docs and CI updates
v2.2.0

PHP 8 support added. No major changes.

v2.1.1

Special thanks to @SilvioPahrig for correcting a small bug in the temporary directory pathing with #24

Also contains some minor housekeeping as seen here https://github.com/donatj/mock-webserver/compare/2985505...5f0f43d

v2.1.0

The largest change here is dropping official support for HHVM. While it likely will work in HHVM, getting it to continually work in Travis was simply not worth the effort.

Widens the required version of ralouphie/getallheaders to include 3.x to help people with dependency issues.

Notes the already required ext-json dependency for composer.

Small testing and documentation updates.

Lots of minor code cleanup and CI finagling.

v2.0.0
  • Adds ResponseByMethod object to allow varying responses per HTTP Method.
  • MockWebServer's getLastRequest and getRequestByOffset now return RequestInfo objects rather than data arrays
  • Many under the hood fixes.
v1.0.0

Small interface change, major rewrite!

v1.0.0-beta.3

This corrects a bug where you'd get a JSON body if you'd requested an empty string body.

v1.0.0-beta.2

A number of fixes from the first beta for PHP5 specifically.

v1.0.0-beta

Beta This is a major breaking release.

Switches to a more object oriented system. The biggest change for the interface is you need to pass the methods setResponseOfPath and getUrlOfResponse Response donatj\MockWebServer\Responseobjects rather than body/headers/status.

This also adds the useful ResponseStack which allows you to line up multiple ordered responses on a single endpoint.

v0.5.0

Adds a getRequestByOffset method that allows you to inspect requests other than just the most recent.

v0.4.1

That's it, just a very minor note that it requires ext-sockets as it was an issue for me.

v0.4.0

If you don't specify a port, we will now automatically ask the OS for an open port to use.

v0.2.0
v0.1.0
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