The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Actively Maintained v1.1.2

Blackbird Magento Mock Object

blackbird/magento-mock-object

Provides ready-made mock objects implementing Magento DataObject methods (getData/setData, etc.) for use in PHPUnit tests, removing the need to manually stub these common methods when mocking the many Magento objects that extend DataObject.

202
Downloads
Below average
1
GitHub Stars
Below average
2mo ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
21 warnings
L5 PHPStan

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.1.2 on Magento 2.4.9
Jun 1, 2026

Share This Module's Status

Blackbird Magento Mock Object Magento compatibility status badge

README

Loaded from GitHub

magento-mock-object

This module is a simple repository to use on require-dev to have available objects that implements DataObject methods.

Since almost every object in magento extends from DataObject, mocking object with PHPUnit can be painful as you have to handle popular methods like getData() or setData() manually on every object you mock.

More objects will be added.

Setup

Get the package

Composer Package:

composer require --dev blackbird/magento-mock-object

Install the module

Go to your Magento root directory and run the following magento command:

php bin/magento setup:upgrade

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.