james at rezo dot net
Home page > PHP > My QA Tools

My QA Tools

Sunday 25 September 2016, by James

All the versions of this article: [English] [français]

The same needs always come back when I do things in PHP :

  • To make tests,
  • To ensure that the code will meet certain conventions and standards,
  • To check the code will run for a maximum of PHP versions.

For these needs, I always end up using the same tools and I find myself quite often with the same configuration in my “composer.json” files :

   "require-dev": {
       "phpunit/phpunit": "^4.8 || ^5.5",
       "squizlabs/php_codesniffer": "^2.7",
       "phpmd/phpmd": "^2.4",
       "theseer/phpdox": "^0.8 || ^0.9.0",
       "sebastian/phpcpd": "^2.0",
       "nikic/php-parser": "^1.3 || 3.*@beta",
       "phpbench/phpbench": "^0.10 || ^0.12.0",
       "phing/phing": "^2.15",
       "phploc/phploc": "^2.1 || ^3.0",
       "friendsofphp/php-cs-fixer": "^1.12",
       "sensiolabs/security-checker": "^4.0"

Composer allows to specify different types of components, in particular the "metapackage" type :

An empty package that contains requirements and will trigger their installation, but contains no files and will not write anything to the filesystem. As such, it does not require a dist or source key to be installable.

So, I made my own metapackage JamesRezo/QaTools that I can add as a dependency in projects that require these tools :

   "require-dev" : {
       "jamesrezo/qatools": "^1.0"

There are many other metapackages of this kind, often set up for the development of a framework, such as https://github.com/bearsunday/BEAR.... which works only from PHP 5.6 version, https://github.com/lovullo/phpqatools which installs the same tools but in stable (and quite old) releases, and especially https://github.com/h4cc/phpqatools the first metapackage I discovered and which I used as a reference to write my own.

SPIP | template | | Site Map | Follow-up of the site's activity RSS 2.0