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.
Build Tests
Code Quality
Tested on Magento 2.4.9
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubmagento-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.