Integration testing

Integration tests test the interaction between individual components, layers, and an environment. They can be found in the dev/tests/integration directory. Like unit tests, Magento also uses PHPUnit for integration tests. Thus, the difference between a unit and an integration test is not that much of a technical nature; rather, it's of a logical nature.

To specifically trigger integration tests only, we can execute the following command on the console:

php bin/magento dev:tests:run integration

When executed, Magento internally changes the directory to dev/tests/integration and executes a command that is similar to the following one:

php /Users/branko/www/magento2/./vendor/phpunit/phpunit/phpunit

The integration directory has ...

Get Magento 2 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.