This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.

Test your component

Unit and Integration Tests

Run the PHPUnit based Magento unit and integration tests. See the Magento Testing Overview.

Functional testing

For further testing with the Magento functional testing frameworks, see [Functional Testing Framework] and Magento 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.

1
2
3
4
"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 Magento functionality.

Test installing your component

Before you publish your component, test installing it.

  1. Package your component in a GitHub repository that is accessible by the machine on which you run the Magento Admin.
  2. 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:

    1
    
     <IP or hostname of your GitHub repository> https://repo.magento.com
    
  3. Install your component.
  4. Verify it installed correctly.

More information

See these resources for testing in PHP and validating Magento components: