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

Mocker Laravel Package

reecem/mocker

A lightweight Laravel-friendly mocking helper for PHP tests. Quickly define and swap mocks, set expectations, and control return values to simplify unit and feature testing. Designed to reduce boilerplate and keep test setup clean and readable.

View on GitHub
Deep Wiki
Context7
v1.2.0

[1.2.0] - 08.02.22

Added

  • Add support for Laravel 9
v1.1.5

Changes

  • Add support for Laravel 8 #16
v1.1.4

1.1.4

Fixed

  • Variables are no longer polluted between variable calls. #6

  • When calling an object that has an array assigned it will return whole the array as a string, see for more #5

  • See pull request #15

Note

There is a slight bug introduced with this version as to the fact that the arrays returned after the first step are arrays and not instances of Mocked. Cannot assign values after assigning the first time.

v1.1.3

Feature

Add support for laravel 7.0 See merge #13, @blakehooks

v1.1.2

Update requirements to support Laravel 6

Update tests to use latest methods for phpunit

v1.1.1

Adds array functionality to mocked objects see PR #4

Features

  • adds ArrayObject type to the mocked class
  • functionality to do $mocked->obj['assoc']['array']->calls
v1.1.0

This release adds a more readable output to the __toString() magic method, this is from #1 feature request.

This came in by means of PR #2

Features

  • Readable output e.g. {{ $mocked->value->name }} == mocked->value->name
    • If the value is set in the class its from it would be mocked->value->name => ["value set"]
  • The values set persists during the calls even if it traverses back and forth in the calling of magic __get()

Misc

  • Testing added
v1.0.2

Provides backwards compatibility with Laravel projects ^5.6 for the illuminate/support and illuminate/filesystem packages

v1.0.1

Fix

fix the psr-4 namespacing issue cause special

  • 4956a1c
v1.0

The initial release of the mocking package

This only does the base thing of getting the params from the __constructor() method in a php class passed to it

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope