Test your component

Unit and Integration Tests

Run the PHPUnit based Magento unit and integration tests. For more information see the Magento Testing Overview

Functional testing

For further testing with the Magento functional testing frameworks, see Functional Testing Framework.

Test using Community Edition

Test your component by deploying Magento Community Edition and adding the component to the project’s composer.json.

"require": {
    "magento/magento-composer-installer": "*",
    "magento/product-community-edition": "2.0.0",
    "yourvendorname/module-one": "0.1.1"
},

Remember to register your component as well, adding the location of your component. Confirm that your component works as expected and Magento functionality is not compromised.

Test installing your component

Before you publish your component, you should test installing it using the Magento Component Manager (part of the Magento Admin).

One way to do this follows:

  1. Package your component in a GitHub repository that’s 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:

    <IP or host name of your GitHub repository> https://repo.magento.com
    
  3. Install your component exactly like a merchant.
  4. Verify the component installed properly.

More information

For more information on testing in PHP and validating Magento components, see the following: