Test your component
Unit and integration tests
Run the PHPUnit based Adobe Commerce and Magento Open Source unit and integration tests. See the Testing Overview.
Functional testing
For further testing with the functional testing frameworks, see Functional Testing Framework.
Test using Magento Open Source
Test your component by deploying Magento Open Source and adding the component to the project's composer.json
. To install, see Install using Composer.
Copied to your clipboard"require": {"magento/magento-composer-installer": "*","yourvendorname/module-one": "0.1.1"},
Register your component, including the file location. Verify it works as expected, without compromising functionality.
Test installing your component
Before you publish your component, test installing it.
Package your component in a GitHub repository that is accessible by the machine on which you run the Admin.
On that machine, create a static route from
https://repo.magento.com
to your GitHub repository.To create a static route, add a line similar to the following to your
hosts
file:Copied to your clipboard<IP or hostname of your GitHub repository> https://repo.magento.comVerify it installed correctly.
More information
See these resources for testing in PHP and validating components:
- The Coding Standard provides a set of rules and sniffs for the PHP_CodeSniffer tool
- Extension Quality Program in the Commerce Marketplace guide