{"id":15159633,"url":"https://github.com/bartoszkubicki/magento2-unit-tests-doubles","last_synced_at":"2025-10-25T17:47:16.650Z","repository":{"id":62494838,"uuid":"207472763","full_name":"bartoszkubicki/magento2-unit-tests-doubles","owner":"bartoszkubicki","description":"Magento 2 Unit Tests Doubles","archived":false,"fork":false,"pushed_at":"2021-10-25T21:53:51.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T20:56:04.595Z","etag":null,"topics":["magento","magento2","magento2-extension","magento2-module","mock","mocking","overmocking","phpunit","stub","stubbing","unit-test","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartoszkubicki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-10T05:30:54.000Z","updated_at":"2021-10-25T21:46:29.000Z","dependencies_parsed_at":"2022-11-02T11:18:05.643Z","dependency_job_id":null,"html_url":"https://github.com/bartoszkubicki/magento2-unit-tests-doubles","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bartoszkubicki/magento2-unit-tests-doubles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartoszkubicki%2Fmagento2-unit-tests-doubles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartoszkubicki%2Fmagento2-unit-tests-doubles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartoszkubicki%2Fmagento2-unit-tests-doubles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartoszkubicki%2Fmagento2-unit-tests-doubles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartoszkubicki","download_url":"https://codeload.github.com/bartoszkubicki/magento2-unit-tests-doubles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartoszkubicki%2Fmagento2-unit-tests-doubles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262740005,"owners_count":23356819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["magento","magento2","magento2-extension","magento2-module","mock","mocking","overmocking","phpunit","stub","stubbing","unit-test","unit-testing"],"created_at":"2024-09-26T21:41:01.146Z","updated_at":"2025-10-25T17:47:11.617Z","avatar_url":"https://github.com/bartoszkubicki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BKubicki Magento 2 Unit Tests Doubles\n\n\n## Overview\nLibrary provides useful doubles of different kinds for unit testing of Magento 2.3+. Some of the doubles can be created using\ndedicated builders, which helps in configuring desired behavior of doubles.\nBy using these doubles you can get rid of over-mocking in unit tests and time spent on writing unit should decrease. \nIt can be achieved because all doubles inherits or implements replaced object or interface,\nso type consistency is preserved. Examples in [here](EXAMPLES.md).\n\n\n## Prerequisites\n* PHP ^7.4\n\n\n## Installation ###\n\nTo install the extension use the following commands:\n\n```bash\n composer require bkubicki/magento2-unit-tests-doubles\n ```\n \n\n## Tests ##\n\n\n### Unit ###\nRun command\n```\ncomposer test-unit-coverage\n```\n\nwhich is an alias for\n```\n./vendor/bin/phpunit -c phpunit.xml --testsuite \"Unit\" --coverage-html coverage/coverage-html --colors=always\n```\n\n  \n### Integration\nRun command \n```\ncomposer test-integration\n```\n\nwhich is an alias for\n```\n./vendor/bin/phpunit -c phpunit.xml --testsuite \"Integration\" --colors=always\n```\n\n    \n### Mutation tests (using Infection) ###\n\n1. Infection tests requires xDebug enabled.\n\n2. Run command\n   ```\n   composer test-infection\n   ```\n\n    which does the following:\n    - Run PHPUnit tests and generate coverage in xml:\n      ```\n      ./vendor/bin/phpunit -c phpunit.xml --testsuite \"Unit\" --coverage-xml coverage/coverage-xml --log-junit coverage/phpunit.junit.xml\n      ```\n    - Run Infection mutation tests for covered code    \n      ```\n      ./vendor/bin/infection --coverage=coverage --only-covered --show-mutations\n      ```\n    \n3. Find detailed report from mutations in ```var/log/dev/infection.log```.\n\n\n  \n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/bartoszkubicki/magento2-unit-tests-doubles/tags).\n\n\n## Changelog\n\nSee changelog [here](CHANGELOG.md).\n\n\n## Authors\n\n* [Bartosz Kubicki](https://github.com/bartoszkubicki)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartoszkubicki%2Fmagento2-unit-tests-doubles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartoszkubicki%2Fmagento2-unit-tests-doubles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartoszkubicki%2Fmagento2-unit-tests-doubles/lists"}