mercadopago/magento2-plugin

Mercado Pago Magento 2 Plugin


Keywords
cart, magento, magento-2, mercadopago, plugin
Licenses
OSL-3.0/AFL-3.0

Documentation

MercadoPago

Magento 2 - Mercado Pago Module (v3.19.0)

The Mercado Pago plugin for Magento 2 allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.

Documentation in English

For a better experience, you will be redirected to our site by clicking on the links below:

DocumentaciĆ³n en EspaƱol

Para una mejor experiencia, serĆ” redirigido a nuestro sitio haciendo clic en los links a abajo:

DocumentaĆ§Ć£o em PortuguĆŖs

Para uma melhor experiĆŖncia, vocĆŖ serĆ” redirecionado para o nosso site, clicando nos links abaixo:

Support

Something's wrong? Get in touch with our support

How to code unit tests

This description is intended to help the developer to run the plugin unit tests

Where to write tests - Test project structure

The plugin is divided into two directories in src:

  • Core : where are the codes for all the functionalities
  • Test/Unit: where are the unit tests

"Test/Unit" mirrors the Core folder, so, if in the Core folder I have a "foo" directory with the file "bar":

Core/foo/bar.php

means that the test folder should look like this (same folder, suffixing the file with "Test"):

Test/Unit/foo/barTest.php

Running tests in development environment

Once this plugin is installed in your development environment with Magento, use the phpUnit that is already installed in magento to run the tests. You can do this by calling phpUnit inside Magento's "vendor" directory and pointing to the plugin's installation location (which will probably be app/code/MercadoPago), for example:

magento/vendor/phpunit/phpunit/phpunit --whitelist magento2/app/code/MercadoPago/Core magento/app/code/MercadoPago/Test
  • magento/vendor/phpunit/phpunit/phpunit: calls phpUnit
  • --whitelist magento2/app/code/MercadoPago/Core : Whitelist for code coverage analysis.
  • --whitelist magento2/app/code/MercadoPago/Test : Directory where phpUnit will find the tests.

Tests on GitHub Actions Workflow

Every time you submit a pull request to this repository, a workflow will be triggered that will run the unit tests. If your unit test fails, you won't be able to merge the pull request.