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

Stub Laravel Package

codeception/stub

Create lightweight test doubles for PHP with Codeception Stub. Quickly generate stubs and mocks, define method returns and expectations, and override behavior on the fly—ideal for unit tests that need fast, flexible objects without full implementations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Supports strategic decisions to prioritize lightweight, maintainable testing infrastructure over custom-built solutions, reducing technical debt in test code.
  • Enables faster test development by eliminating boilerplate for stubs/mocks, accelerating CI/CD pipelines through more reliable and isolated unit tests.
  • Ideal for teams using PHPUnit/Codeception who need to isolate dependencies quickly, especially in legacy codebases where complex mocking frameworks add unnecessary complexity.
  • Reduces the need to maintain in-house mocking utilities, allowing engineering resources to focus on feature development instead of test tooling.

When to Consider This Package

  • Adopt when your team uses PHPUnit or Codeception and needs simple, readable stubbing for unit tests without advanced mocking features (e.g., strict interaction verification, dynamic argument matching).
  • Consider when minimizing dependencies is critical (e.g., microservices with strict dependency policies) or when tests require rapid setup without complex configuration.
  • Look elsewhere if you need advanced mocking capabilities (e.g., mocking static methods, deep object graphs), or if your project uses a different testing framework (e.g., Pest, which has built-in mocking), or if the team is already invested in a full-featured mocking library like Mockery.

How to Pitch It (Stakeholders)

  • Executives: "This package reduces test maintenance time by streamlining stub creation, directly accelerating feature delivery and release velocity. With MIT licensing and zero new dependencies, it’s a cost-effective, low-risk solution to boost engineering productivity without disrupting existing workflows."
  • Engineering: "Simplifies test double creation with a clean, intuitive API that cuts boilerplate by 50%, making tests more readable and maintainable. Seamlessly integrates with PHPUnit—just add it to your project and start stubbing methods in 3 lines of code, with no additional configuration or learning curve."
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation