2017 © Pedro Peláez
 

composer-plugin testing-suite

Contains MediaCT's default testing packages.

image

mediact/testing-suite

Contains MediaCT's default testing packages.

  • Thursday, April 12, 2018
  • by mediactbv
  • Repository
  • 3 Watchers
  • 1 Stars
  • 2,421 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 40 Versions
  • 36 % Grown

The README.md

Scrutinizer Code Quality, (*1)

[ABANDONED] MediaCT Testing Suite

This package has been abandoned and will not get any support. We replaced it with the youwe testing suite., (*2)

This package serves as an umbrella package for several of MediaCT's testing packages., (*3)

Installation

composer require mediact/testing-suite --dev

Usage

The testing suite can be run through the GrumPHP command., (*4)

vendor/bin/grumphp run

The testing suite is also automatically run at each git commit using a git commit hook., (*5)

Components

The following components are part of the testing suite., (*6)

Coding style validation (PHPCS)

The coding style is validated using PHPCS and uses the MediaCT Coding Standard., (*7)

During the installation of the testing suite a file called phpcs.xml is added to the root of the repository which refers to the coding standard. To make adjustments to the coding standard this file can be edited and committed., (*8)

Depending on the composer type of the project an other standard will be used:, (*9)

Overriding the type

The type for a project can be overridden in the composer.json config node by adding testing-suite-type to the configuration. This will allow the use of standards for a different type. The allowed values for this node are: - magento1 - magento2 - default, (*10)

The configurations looks like the following:, (*11)

{
  "config": {
    "mediact-testing-suite": {
      "type": "magento2"
    }
  }
}

This can be helpful when development is done in the app/code folder and force the testing suite to automatically select the correct standards., (*12)

Coding complexity validation (PHPMD)

The complexity of the code is validated using PHPMD. A file called phpmd.xml is added during the installation of the testing suite., (*13)

Static code analysis (PHPStan)

Static code analysis is executed using PHPStan. A file called phpstan.neon is added during the installation of the testing suite., (*14)

Unit tests (PHPUnit)

Unit tests are executed using PHPUnit. A file called phpunit.xml is added during the installation of the testing suite., (*15)

The unit tests are expected to be in a directory called tests. The code is expected to be in a directory called src., (*16)

Bitbucket Pipelines

When the project is hosted on Bitbucket a Pipelines script will be installed. The scripts supports a callback that will be called before composer install is executed. This callback can be used to add credentials to composer. To enable the callback go to Bitbucket Settings > Pipelines > Environment Variables and add an environment variable called COMPOSER_PRE_INSTALL_CALLBACK., (*17)

Example to add basic authentication for repo.example.com:, (*18)

composer config --global http-basic.repo.example.com $YOUR_USER $YOUR_PASSWORD

ESLint

Javascript linting for Magento 1 and Magento 2 projects is executed using ESLint. Two files called .eslintrc.json and .eslintignore are added to the root of the repository which contains the coding standards and files excluded from analysis., (*19)

A third file called package.json is added which contains the needed npm modules. Run npm install after the installation in order to enable ESLint:, (*20)

npm install

Integration with PHPStorm

When the testing suite is installed in a PHPStorm environment it automatically configures PHPStorm to use the correct coding style., (*21)

To enable PHPCS and PHPMD inspections in PHPStorm the correct binaries need to be configured. This is a global setting in PHPStorm and can therefore not be configured by the testing suite., (*22)

The recommended way to get the correct binaries is by installing the MediaCT Coding Standard globally., (*23)

composer global require mediact/coding-standard

The package will be installed in the home directory of composer. The location of this directory can be found using the following command:, (*24)

composer global config home

Open PHPStorm and go to Settings > Languages & Frameworks > PHP > Code Sniffer., (*25)

Choose "Local" for the development environment and fill in the full path to <composer_home_directory>/vendor/bin/phpcs., (*26)

Then go to Settings > Languages & Frameworks > PHP > Mess Detector., (*27)

Choose "Local" for the development environment and fill in the full path to <composer_home_directory>/vendor/bin/phpmd., (*28)

After these adjustments the coding style and complexity will be validated while typing in PHPStorm., (*29)

To enable ESLint open PHPStorm and go to Settings > Languages & Frameworks > Javascript > Code Quality Tools > ESLint., (*30)

Enable ESLint by checking Enabled. Then set the Node interpreter to Project and Configuration file to Automatic Search., (*31)

The Versions

12/04 2018

dev-feature/eslint-ignore

dev-feature/eslint-ignore

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

11/04 2018
09/02 2018

dev-feature/pre-install-callback

dev-feature/pre-install-callback

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

17/01 2018

dev-feature/symfony-compatibility

dev-feature/symfony-compatibility

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

09/01 2018

dev-feature/exclude-phpstan-check-on-factories

dev-feature/exclude-phpstan-check-on-factories

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

28/11 2017

dev-feature/MAGE2-94

dev-feature/MAGE2-94

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

19/10 2017

dev-feature/bitbucket-pipelines-vendor-cache

dev-feature/bitbucket-pipelines-vendor-cache

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

31/08 2017

dev-feature/lisence

dev-feature/lisence

Contains MediaCT's default testing packages.

  Sources   Download

MIT

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

23/08 2017
21/08 2017
07/06 2017
07/06 2017
01/06 2017

1.2.2

1.2.2.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

30/05 2017

1.2.1

1.2.1.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

30/05 2017

1.2.0

1.2.0.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

10/05 2017

1.1.1

1.1.1.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

10/05 2017

1.1.0

1.1.0.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

The Development Requires

by MediaCT B.V.
by Len Lorijn

20/04 2017

1.0.5

1.0.5.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.

13/04 2017

1.0.4

1.0.4.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.

13/04 2017

1.0.3

1.0.3.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.

11/04 2017

1.0.2

1.0.2.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.

27/03 2017

1.0.1

1.0.1.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.

24/03 2017

1.0.0

1.0.0.0

Contains MediaCT's default testing packages.

  Sources   Download

proprietary

The Requires

 

by MediaCT B.V.