Download the PHP package thesgroup/magento2-testing-framework without Composer

On this page you can find all versions of the php package thesgroup/magento2-testing-framework. 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-testing-framework

Magento 2 Testing Framework

Magento 2 static/unit testing framework for a single module tests. It can be used for a pipeline or to verify a Magento 2 module.

Installation

Run the following command on your Magento 2 project:


Pipeline Examples

Assumes $MAGENTO_USER and $MAGENTO_PASS set as pipeline variables.

Basic Usage

In the most cases you may use basic test suite to run PHP code, JavaScript, PhpUnit tests.

PHP Code

There is an option to run all php tests using one command. It runs following tests:

You can run all tests by using the command:

When you need to delete test files you can use the cleanup command:

PHPUnit

Run unit tests and check for code coverage threshold.

After execution following reports generated:

To set code coverage threshold 80% (The default value 70%):

Javascript

Run ESLint to ensure the quality of your JavaScript code:

Fix ESLint Locally:


Advanced Usage

PHP Coding Standard Verification

These testsuite include: PHPCS, PHPMD, PHPCPD, PHPStan Tests and strict types declaration. You can run it exclusively using the following command:

Code Integrity Tests

You can run it exclusively using the following command:

HTML Static Code Analysis

You can run it exclusively using the following command:

Less Static Code Analysis

You can run it exclusively using the following command:

GraphQL Static Code Analysis

You can run it exclusively using the following command:

PHP Code Beautifier and Fixer (PHPCBF)

To automatically fix as many sniff violations as possible, use the phpcbf command:

Ignoring Files and Folders

Specific files/folders can be added to blacklist at the module folder by adding at new line

PHPCS

PHPMD

PHPCPD

Strict Type Declarations

PHPStan


Information About Tests

Magento Specific Rules

AllPurposeAction

Controllers (classes implementing ActionInterface) have to implement marker HttpActionInterface to restrict incoming requests by methods.

CookieAndSessionMisuse

Sessions and cookies must only be used in classes directly responsible for HTML presentation because Web APIs do not rely on cookies and sessions. If you need to get current user use Magento\Authorization\Model\UserContextInterface

FinalImplementation

Final keyword is prohibited in Magento as this decreases extensibility and customizability. Final classes and method are not compatible with plugins and proxies.

Code Integrity Tests

The command above will perform following tests:

Contribute To The Module

Feel free to Fork and contribute to this module and create a pull request so we will merge your changes to master branch.

Credits

Thanks the the contributors

Related Resources


All versions of magento2-testing-framework with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0||~8.2.0
magento/framework Version 103.0.*
magento/module-webapi Version 100.4.*
magento/magento-coding-standard Version *
rregeer/phpunit-coverage-check Version *
phpunit/phpunit Version ^9.5
laminas/laminas-code Version ^4.5
phpstan/phpstan Version ^1.9
phpmd/phpmd Version ~2.12.0
sebastian/phpcpd Version ^6.0
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 thesgroup/magento2-testing-framework contains the following files

Loading the files please wait ....