Download the PHP package yireo/magento2-integration-test-helper without Composer

On this page you can find all versions of the php package yireo/magento2-integration-test-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-integration-test-helper

Magento 2 integration testing helper

This module adds various utilities to aid in creating integration tests for Magento 2.

Installation

Use the following commands to install:

composer require yireo/magento2-integration-test-helper --dev

Enable this module:

./bin/magento module:enable Yireo_IntegrationTestHelper
./bin/magento setup:upgrade

Using this helper to enhance your tests

Parent classes:

These classes offer some utility functions plus import numerous traits (see Test/Integration/Traits/) with PHPUnit assertions. For instance, the following test checks for the proper registration of your module:

Toggle TESTS_CLEANUP in integration tests configuration

When running integration tests, you probably want to frequently toggle the constant TESTS_CLEANUP from disabled to enabled to disabled. The following command-line easily allows for this (assuming the file is actually dev/tests/integration/phpunit.xml cause you shouldn't modify the *.dist version):

bin/magento integration_tests:toggle_tests_cleanup

It is toggled. You can also set the value directly:

bin/magento integration_tests:toggle_tests_cleanup enabled

Generating the install-config-mysql.php return array

When installing Magento - as part of the procedure of running Integration Tests - the file dev/tests/integration/etc/install-config-mysql.php should return an array with all of your relevant settings, most importantly the database settings. By using the utility class Yireo\IntegrationTestHelper\Utilities\InstallConfig you can quickly generate the relevant output, plus details like Redis and ElasticSearch:

Disable modules when installing Magento

When installing Magento - as part of the procedure of running Integration Tests - the file dev/tests/integration/etc/install-config-mysql.php is modified to point to your test database. There is also a flag disable-modules that allows you to disable specific Magento modules. Disabling modules is a benefit for performance. The utility class Yireo\IntegrationTestHelper\Utilities\DisableModules allows you to generate a listing of modules to disable quicker.

In the following example, first all (!) modules that are listed in the global app/etc/config.php are disabled by default. But then all Magento core modules and the module Yireo_GoogleTagManager2 are enabled (but only if they are marked as active in the global configuration):

Instead of using a hard-coded value, you might also want to set an environment variable MAGENTO_MODULE - for instance, in the Run configuration in PHPStorm - which is then reused via the method enableByMagentoModuleEnv. This way, you can keep the same install-config-mysql.php file while reusing it for various Run configurations:

Another example, all the Magento modules are enabled by default. But then MSI and GraphQL are disabled again, while all Yireo modules are enabled:

Note that if there would be a module Yireo_ExampleGraphQl then this would be first disabled with disableGraphQl() and then re-enabled again with enableByPattern('Yireo_'). The ordering of your methods matters!

Validating your configuration

The module also ships with a CLI command to easily check whether the currently returned setup:install flags make sense:


All versions of magento2-integration-test-helper with dependencies

PHP Build Version
Package Version
Requires magento/framework Version ^101.0.1|^101.1|^102.0|^103.0
nette/php-generator Version ^4.1
nette/utils Version ^4.0
symfony/finder Version ^4.0 || ^5.0 || ^6.0
php Version 8.0.* || 8.1.* || 8.2.* || 8.3.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yireo/magento2-integration-test-helper contains the following files

Loading the files please wait ....