From d41ca89ea82c879d1232f1537ae728ab74e3d26d Mon Sep 17 00:00:00 2001 From: Reinier Kip Date: Fri, 24 Feb 2017 15:37:22 +0100 Subject: [PATCH] Dogfood QA Tools 3.0.0-alpha2 * Don't use generated Ant build file; our QA process is custom and too complex to ever want to offer using QA Tools configuration. This commit does try to stay as close as possible to the commands from the build file. * As QA Tools doesn't (yet?) support multiple test suites in PHPUnit, they are now organised by directory, rather than by suite. * As QA Tools doesn't (yet?) support a configured PHPUnit bootstrap file, it is passed to the binary using an option --- .gitignore | 1 + Makefile | 17 +- composer.json | 8 +- composer.lock | 370 +++++++++--------- phpcs.xml | 10 - phpmd.xml | 12 +- phpunit.xml | 40 +- qa-tools.json | 23 ++ ruleset.xml | 18 + src/Core/Application/Application.php | 4 + src/Core/Application/ContainerLoader.php | 4 + .../PhpCs/Configurator/PhpCsConfigurator.php | 4 + .../Configurator/PhpUnitConfigurator.php | 4 + tests/integration/Installer/InstallerTest.php | 19 +- tests/system/SystemTest.php | 3 + tests/unit/Installer/InstallerTest.php | 28 +- 16 files changed, 317 insertions(+), 248 deletions(-) delete mode 100644 phpcs.xml create mode 100644 qa-tools.json create mode 100644 ruleset.xml diff --git a/.gitignore b/.gitignore index dde0a18..5fdd543 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ /var/cache/* /bin/box /box.json +/build.xml /signing-key-*.pem diff --git a/Makefile b/Makefile index 75edd6c..98c4bc1 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,7 @@ test: test-unit test-integration test-system-dev code-metrics clean build-test t test-fast: test-unit test-integration test-system-dev code-metrics verify-readme-installer-hash coverage: - vendor/bin/phpunit -c . --testsuite unit,integration --coverage-text - + vendor/bin/phpunit --coverage-text --bootstrap tests/bootstrap.php --exclude-group system test-unit: phpunit-unit test-integration: phpunit-integration @@ -48,21 +47,21 @@ verify-build: test-no-absolute-paths-in-container phpunit-unit: - vendor/bin/phpunit -c . --testsuite unit + vendor/bin/phpunit tests/unit --bootstrap tests/bootstrap.php phpunit-integration: - vendor/bin/phpunit -c . --testsuite integration + vendor/bin/phpunit tests/integration --bootstrap tests/bootstrap.php phpunit-system-dev: - vendor/bin/phpunit -c . --testsuite system + vendor/bin/phpunit tests/system --bootstrap tests/bootstrap.php phpunit-system-phar: - QA_TOOLS_BIN=phar vendor/bin/phpunit -c . --testsuite system + QA_TOOLS_BIN=phar vendor/bin/phpunit tests/system --bootstrap tests/bootstrap.php phplint: - vendor/bin/parallel-lint -e php --exclude vendor . + vendor/bin/parallel-lint --exclude vendor -e php . phpcs: # Blank line is needed to provide STDIN input to phpcs when phpcs is called from the Git pre-push hook context # See https://github.com/squizlabs/PHP_CodeSniffer/issues/993 - echo '' | vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1 --standard=phpcs.xml --extensions=php --report=full src + echo '' | vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1 --report=full --standard=ruleset.xml --extensions=php/php src phpmd: - vendor/bin/phpmd src text phpmd.xml + vendor/bin/phpmd src text phpmd.xml --suffixes php verify-test-build-is-signed: build-test diff --git a/composer.json b/composer.json index 06db2a6..02b2a53 100644 --- a/composer.json +++ b/composer.json @@ -46,12 +46,12 @@ "jakub-onderka/php-parallel-lint": "^0.9.2", "liip/rmt": "^1.2.5", "mockery/mockery": "^0.9.4", - "phpmd/phpmd": "^2.4", - "phpunit/phpunit": "^5.4", + "phpmd/phpmd": "^2.0", + "phpunit/phpunit": "^5.7", "sebastian/diff": "^1.4", - "sebastian/exporter": "^1.2", + "sebastian/exporter": "^2", "sensiolabs/security-checker": "^3.0", - "squizlabs/php_codesniffer": "^2.6", + "squizlabs/php_codesniffer": "^2.7", "symfony/filesystem": "^3.1" }, "config": { diff --git a/composer.lock b/composer.lock index 99c2daf..8f2e97d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "d26ed17e8cd5e138ecf4334f285e7d6d", - "content-hash": "6875338ac63da4f73fff71179ce9ef1a", + "content-hash": "7f90299db985573afa08eb4d15d58774", "packages": [ { "name": "beberlei/assert", @@ -58,7 +57,7 @@ "assertion", "validation" ], - "time": "2016-03-22 14:34:51" + "time": "2016-03-22T14:34:51+00:00" }, { "name": "composer/semver", @@ -120,7 +119,7 @@ "validation", "versioning" ], - "time": "2016-06-02 09:04:51" + "time": "2016-06-02T09:04:51+00:00" }, { "name": "guzzlehttp/guzzle", @@ -182,7 +181,7 @@ "rest", "web service" ], - "time": "2016-07-15 17:22:37" + "time": "2016-07-15T17:22:37+00:00" }, { "name": "guzzlehttp/promises", @@ -233,7 +232,7 @@ "keywords": [ "promise" ], - "time": "2016-05-18 16:56:05" + "time": "2016-05-18T16:56:05+00:00" }, { "name": "guzzlehttp/psr7", @@ -291,7 +290,7 @@ "stream", "uri" ], - "time": "2016-06-24 23:00:38" + "time": "2016-06-24T23:00:38+00:00" }, { "name": "padraic/humbug_get_contents", @@ -348,7 +347,7 @@ "ssl", "tls" ], - "time": "2015-04-22 18:45:00" + "time": "2015-04-22T18:45:00+00:00" }, { "name": "padraic/phar-updater", @@ -400,7 +399,7 @@ "self-update", "update" ], - "time": "2016-01-05 23:08:01" + "time": "2016-01-05T23:08:01+00:00" }, { "name": "psr/http-message", @@ -450,7 +449,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", @@ -488,7 +487,7 @@ "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2012-12-21T11:40:51+00:00" }, { "name": "symfony/config", @@ -541,7 +540,7 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-08-27 18:50:07" + "time": "2016-08-27T18:50:07+00:00" }, { "name": "symfony/console", @@ -601,7 +600,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-08-19 06:48:39" + "time": "2016-08-19T06:48:39+00:00" }, { "name": "symfony/dependency-injection", @@ -661,7 +660,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-08-23 13:39:15" + "time": "2016-08-23T13:39:15+00:00" }, { "name": "symfony/filesystem", @@ -710,7 +709,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-10-18 04:30:12" + "time": "2016-10-18T04:30:12+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -769,7 +768,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/process", @@ -818,7 +817,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-08-16 14:58:24" + "time": "2016-08-16T14:58:24+00:00" }, { "name": "symfony/yaml", @@ -867,7 +866,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-09-02 02:12:52" + "time": "2016-09-02T02:12:52+00:00" }, { "name": "twig/twig", @@ -928,7 +927,7 @@ "keywords": [ "templating" ], - "time": "2016-01-25 21:22:18" + "time": "2016-01-25T21:22:18+00:00" }, { "name": "zendframework/zend-json", @@ -978,7 +977,7 @@ "json", "zf2" ], - "time": "2016-04-01 02:34:00" + "time": "2016-04-01T02:34:00+00:00" } ], "packages-dev": [ @@ -1037,7 +1036,7 @@ "ssl", "tls" ], - "time": "2016-07-18 23:07:53" + "time": "2016-07-18T23:07:53+00:00" }, { "name": "composer/composer", @@ -1114,7 +1113,7 @@ "dependency", "package" ], - "time": "2016-07-18 23:28:52" + "time": "2016-07-18T23:28:52+00:00" }, { "name": "composer/spdx-licenses", @@ -1175,7 +1174,7 @@ "spdx", "validator" ], - "time": "2016-05-04 12:27:30" + "time": "2016-05-04T12:27:30+00:00" }, { "name": "container-interop/container-interop", @@ -1202,7 +1201,7 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30 15:22:37" + "time": "2014-12-30T15:22:37+00:00" }, { "name": "couscous/couscous", @@ -1250,7 +1249,7 @@ "license": [ "MIT" ], - "time": "2016-06-02 17:37:46" + "time": "2016-06-02T17:37:46+00:00" }, { "name": "doctrine/instantiator", @@ -1304,7 +1303,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "erusev/parsedown", @@ -1343,7 +1342,7 @@ "markdown", "parser" ], - "time": "2015-10-04 16:44:32" + "time": "2015-10-04T16:44:32+00:00" }, { "name": "erusev/parsedown-extra", @@ -1387,7 +1386,7 @@ "parsedown", "parser" ], - "time": "2015-11-01 10:19:22" + "time": "2015-11-01T10:19:22+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -1432,7 +1431,7 @@ "keywords": [ "test" ], - "time": "2015-05-11 14:41:42" + "time": "2015-05-11T14:41:42+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -1475,7 +1474,7 @@ "homepage": "http://www.acci.cz" } ], - "time": "2014-04-08 15:00:19" + "time": "2014-04-08T15:00:19+00:00" }, { "name": "jakub-onderka/php-console-highlighter", @@ -1519,7 +1518,7 @@ "homepage": "http://www.acci.cz/" } ], - "time": "2015-04-20 18:58:01" + "time": "2015-04-20T18:58:01+00:00" }, { "name": "jakub-onderka/php-parallel-lint", @@ -1566,7 +1565,7 @@ ], "description": "This tool check syntax of PHP files about 20x faster than serial check.", "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", - "time": "2015-12-15 10:42:16" + "time": "2015-12-15T10:42:16+00:00" }, { "name": "justinrainbow/json-schema", @@ -1632,7 +1631,7 @@ "json", "schema" ], - "time": "2016-06-02 10:59:52" + "time": "2016-06-02T10:59:52+00:00" }, { "name": "liip/rmt", @@ -1691,7 +1690,7 @@ "vcs tag", "version" ], - "time": "2016-11-07 05:33:08" + "time": "2016-11-07T05:33:08+00:00" }, { "name": "mnapoli/front-yaml", @@ -1725,7 +1724,7 @@ "license": [ "MIT" ], - "time": "2016-10-01 11:06:51" + "time": "2016-10-01T11:06:51+00:00" }, { "name": "mockery/mockery", @@ -1790,20 +1789,20 @@ "test double", "testing" ], - "time": "2016-05-22 21:52:33" + "time": "2016-05-22T21:52:33+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "a8773992b362b58498eed24bf85005f363c34771" + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", - "reference": "a8773992b362b58498eed24bf85005f363c34771", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", "shasum": "" }, "require": { @@ -1832,20 +1831,20 @@ "object", "object graph" ], - "time": "2015-11-20 12:04:31" + "time": "2017-01-26T22:05:40+00:00" }, { "name": "pdepend/pdepend", - "version": "2.2.4", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06" + "reference": "0c50874333149c0dad5a2877801aed148f2767ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/0c50874333149c0dad5a2877801aed148f2767ff", + "reference": "0c50874333149c0dad5a2877801aed148f2767ff", "shasum": "" }, "require": { @@ -1872,7 +1871,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2016-03-10 15:15:04" + "time": "2017-01-19T14:23:36+00:00" }, { "name": "phine/exception", @@ -1922,7 +1921,7 @@ "exception" ], "abandoned": true, - "time": "2013-08-27 17:43:25" + "time": "2013-08-27T17:43:25+00:00" }, { "name": "phine/observer", @@ -1974,7 +1973,7 @@ "observer" ], "abandoned": true, - "time": "2013-12-17 23:50:08" + "time": "2013-12-17T23:50:08+00:00" }, { "name": "phine/path", @@ -2027,7 +2026,7 @@ "system" ], "abandoned": true, - "time": "2013-10-15 22:58:04" + "time": "2013-10-15T22:58:04+00:00" }, { "name": "phine/phar", @@ -2084,7 +2083,7 @@ "phar" ], "abandoned": "box-project/box2", - "time": "2013-12-18 00:12:41" + "time": "2013-12-18T00:12:41+00:00" }, { "name": "php-di/invoker", @@ -2127,7 +2126,7 @@ "invoke", "invoker" ], - "time": "2016-07-14 13:09:58" + "time": "2016-07-14T13:09:58+00:00" }, { "name": "php-di/php-di", @@ -2187,7 +2186,7 @@ "dependency injection", "di" ], - "time": "2016-08-23 20:18:00" + "time": "2016-08-23T20:18:00+00:00" }, { "name": "php-di/phpdoc-reader", @@ -2224,7 +2223,7 @@ "phpdoc", "reflection" ], - "time": "2015-11-29 10:34:25" + "time": "2015-11-29T10:34:25+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2278,20 +2277,20 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2015-12-27T11:43:31+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", "shasum": "" }, "require": { @@ -2323,20 +2322,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-06-10 09:48:41" + "time": "2016-09-30T07:12:33+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2", + "version": "0.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", "shasum": "" }, "require": { @@ -2370,25 +2369,26 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-06-10 07:14:17" + "time": "2016-11-25T06:54:22+00:00" }, { "name": "phpmd/phpmd", - "version": "2.4.3", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e" + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e", - "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", + "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", "shasum": "" }, "require": { - "pdepend/pdepend": "^2.0.4", - "php": ">=5.3.0" + "ext-xml": "*", + "pdepend/pdepend": "^2.5", + "php": ">=5.3.9" }, "require-dev": { "phpunit/phpunit": "^4.0", @@ -2435,20 +2435,20 @@ "phpmd", "pmd" ], - "time": "2016-04-04 11:52:04" + "time": "2017-01-20T14:41:10+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", + "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", "shasum": "" }, "require": { @@ -2456,10 +2456,11 @@ "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0" + "sebastian/recursion-context": "^1.0|^2.0" }, "require-dev": { - "phpspec/phpspec": "^2.0" + "phpspec/phpspec": "^2.0", + "phpunit/phpunit": "^4.8 || ^5.6.5" }, "type": "library", "extra": { @@ -2497,29 +2498,29 @@ "spy", "stub" ], - "time": "2016-06-07 08:13:47" + "time": "2016-11-21T14:58:47+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.0", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" + "reference": "ca060f645beeddebedb1885c97bf163e93264c35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", - "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca060f645beeddebedb1885c97bf163e93264c35", + "reference": "ca060f645beeddebedb1885c97bf163e93264c35", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", "sebastian/code-unit-reverse-lookup": "~1.0", - "sebastian/environment": "^1.3.2", + "sebastian/environment": "^1.3.2 || ^2.0", "sebastian/version": "~1.0|~2.0" }, "require-dev": { @@ -2560,20 +2561,20 @@ "testing", "xunit" ], - "time": "2016-06-03 05:03:56" + "time": "2017-02-23T07:38:02+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", "shasum": "" }, "require": { @@ -2607,7 +2608,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -2648,7 +2649,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -2692,20 +2693,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2016-05-12T18:03:57+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/284fb0679dd25fb5ffb56dad92c72860c0a22f1b", + "reference": "284fb0679dd25fb5ffb56dad92c72860c0a22f1b", "shasum": "" }, "require": { @@ -2741,50 +2742,54 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-02-23T06:14:45+00:00" }, { "name": "phpunit/phpunit", - "version": "5.4.6", + "version": "5.7.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" + "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", - "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4906b8faf23e42612182fd212eb6f4c0f2954b57", + "reference": "4906b8faf23e42612182fd212eb6f4c0f2954b57", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", "myclabs/deep-copy": "~1.3", "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^4.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "^1.2.4", "sebastian/diff": "~1.2", - "sebastian/environment": "^1.3 || ^2.0", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", + "sebastian/version": "~1.0.3|~2.0", "symfony/yaml": "~2.1|~3.0" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2" }, + "require-dev": { + "ext-pdo": "*" + }, "suggest": { + "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -2793,7 +2798,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.4.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -2819,27 +2824,27 @@ "testing", "xunit" ], - "time": "2016-06-16 06:01:15" + "time": "2017-02-19T07:22:16+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.2.3", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "b13d0d9426ced06958bd32104653526a6c998a52" + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", - "reference": "b13d0d9426ced06958bd32104653526a6c998a52", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.6 || ^7.0", "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2" + "sebastian/exporter": "^1.2 || ^2.0" }, "conflict": { "phpunit/phpunit": "<5.4.0" @@ -2878,7 +2883,7 @@ "mock", "xunit" ], - "time": "2016-06-12 07:37:26" + "time": "2016-12-08T20:27:08+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2923,26 +2928,26 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" + "time": "2016-02-13T06:45:14+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -2987,7 +2992,7 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", @@ -3039,32 +3044,32 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", - "version": "1.3.7", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3089,25 +3094,25 @@ "environment", "hhvm" ], - "time": "2016-05-17 03:18:57" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", @@ -3116,7 +3121,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3156,7 +3161,7 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -3207,25 +3212,25 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/object-enumerator", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { "php": ">=5.6", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "phpunit/phpunit": "~5" @@ -3233,7 +3238,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3253,20 +3258,20 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28 13:25:10" + "time": "2017-02-18T15:18:39+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { @@ -3278,7 +3283,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3306,7 +3311,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-11-19T07:33:16+00:00" }, { "name": "sebastian/resource-operations", @@ -3348,20 +3353,20 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { @@ -3391,7 +3396,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-02-04 12:56:52" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "seld/cli-prompt", @@ -3439,7 +3444,7 @@ "input", "prompt" ], - "time": "2016-04-18 09:31:41" + "time": "2016-04-18T09:31:41+00:00" }, { "name": "seld/jsonlint", @@ -3485,7 +3490,7 @@ "parser", "validator" ], - "time": "2015-11-21 02:21:41" + "time": "2015-11-21T02:21:41+00:00" }, { "name": "seld/phar-utils", @@ -3529,7 +3534,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13 18:44:15" + "time": "2015-10-13T18:44:15+00:00" }, { "name": "sensiolabs/security-checker", @@ -3573,20 +3578,20 @@ } ], "description": "A security checker for your composer.lock", - "time": "2015-11-07 08:07:40" + "time": "2015-11-07T08:07:40+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "2.6.2", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83" + "reference": "86dd55a522238211f9f3631e3361703578941d9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83", - "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/86dd55a522238211f9f3631e3361703578941d9a", + "reference": "86dd55a522238211f9f3631e3361703578941d9a", "shasum": "" }, "require": { @@ -3651,7 +3656,7 @@ "phpcs", "standards" ], - "time": "2016-07-13 23:29:13" + "time": "2017-02-02T03:30:00+00:00" }, { "name": "symfony/finder", @@ -3700,7 +3705,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:41:56" + "time": "2016-06-29T05:41:56+00:00" }, { "name": "vierbergenlars/php-semver", @@ -3752,32 +3757,33 @@ "semver", "versioning" ], - "time": "2015-05-02 19:28:54" + "time": "2015-05-02T19:28:54+00:00" }, { "name": "webmozart/assert", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -3801,7 +3807,7 @@ "check", "validate" ], - "time": "2015-08-24 13:29:44" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 266dd2c..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - This is used by the Ibuildings QA tools to wrap the coding standard of your choice. - By default it is less stringent about long lines than other coding standards - - - - - diff --git a/phpmd.xml b/phpmd.xml index cc14940..1f44d06 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -7,7 +7,7 @@ xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd"> - Ibuildings QA Tools Default Ruleset + Ibuildings QA Tools Default Ruleset for QA Tools @@ -25,15 +25,7 @@ - - - - - - - - - + diff --git a/phpunit.xml b/phpunit.xml index e8333d5..82e928f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,35 +1,23 @@ - - - - + + + + + + + - - tests/unit - - - tests/integration - - - tests/unit - tests/integration - - - tests/system + + tests + - + src diff --git a/qa-tools.json b/qa-tools.json new file mode 100644 index 0000000..cd9f43e --- /dev/null +++ b/qa-tools.json @@ -0,0 +1,23 @@ +{ + "projectName": "QA Tools", + "configurationFilesLocation": ".\/", + "projectTypes": [ + "php.other" + ], + "travisEnabled": false, + "answers": { + "4c6702ea73cad3d4fbeb1a275b6dbb4a": "QA Tools", + "82191a2f54943a61240ff714d692663d": ".\/", + "64d5c97247c332c17b131abdde8c873a": "Other PHP Project", + "4735c10b621d2c15142ff92e6ec0a9a9": true, + "1f73d735e7d5a37ff6e8a9c30311a00a": true, + "97016cab401f3bbfaf10dfa47ec8cbd8": true, + "80a50eef71a0a84f0779597a5185008e": true, + "743bcf201e8b6c07fbad359c2bdf79ac": "PSR2", + "be2a788ae62f9166970c6de91c828c53": "Warn when \u003E120. Fail when \u003E150", + "6dd3ae893178cd90a45edaaeceab33f5": false, + "809d51753d308ccf218c0217c00c779d": false, + "5c08b9b1487086e2e506013f8e3fc65f": true, + "c8214ea1830f49699c20dc2b42c4c190": false + } +} \ No newline at end of file diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 0000000..bc63f3d --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,18 @@ + + + Enforce coding standards + + + + + + + + + + + + + + + diff --git a/src/Core/Application/Application.php b/src/Core/Application/Application.php index ec02176..bc14821 100644 --- a/src/Core/Application/Application.php +++ b/src/Core/Application/Application.php @@ -18,6 +18,10 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) -- Due to wide-spread value object usage a higher coupling is + * acceptable + */ final class Application extends ConsoleApplication { const NAME = 'Ibuildings QA Tools'; diff --git a/src/Core/Application/ContainerLoader.php b/src/Core/Application/ContainerLoader.php index 5329187..4ab1fa5 100644 --- a/src/Core/Application/ContainerLoader.php +++ b/src/Core/Application/ContainerLoader.php @@ -14,6 +14,10 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\Filesystem\Filesystem; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) -- Due to wide-spread value object usage a higher coupling is + * acceptable + */ final class ContainerLoader { /** diff --git a/src/Tool/PhpCs/Configurator/PhpCsConfigurator.php b/src/Tool/PhpCs/Configurator/PhpCsConfigurator.php index 0afa578..58a60d6 100644 --- a/src/Tool/PhpCs/Configurator/PhpCsConfigurator.php +++ b/src/Tool/PhpCs/Configurator/PhpCsConfigurator.php @@ -17,6 +17,10 @@ use Ibuildings\QaTools\Core\Task\WriteFileTask; use Ibuildings\QaTools\Tool\PhpCs\PhpCs; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) -- Due to wide-spread value object usage a higher coupling is + * acceptable + */ final class PhpCsConfigurator implements Configurator { const RULESET_SYMFONY = 'Symfony'; diff --git a/src/Tool/PhpUnit/Configurator/PhpUnitConfigurator.php b/src/Tool/PhpUnit/Configurator/PhpUnitConfigurator.php index 834db24..c48c21d 100644 --- a/src/Tool/PhpUnit/Configurator/PhpUnitConfigurator.php +++ b/src/Tool/PhpUnit/Configurator/PhpUnitConfigurator.php @@ -17,6 +17,10 @@ use Ibuildings\QaTools\Core\Task\WriteFileTask; use Ibuildings\QaTools\Tool\PhpUnit\PhpUnit; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) -- Due to wide-spread value object usage a higher coupling is + * acceptable + */ final class PhpUnitConfigurator implements Configurator { /** diff --git a/tests/integration/Installer/InstallerTest.php b/tests/integration/Installer/InstallerTest.php index 6cb7018..f9df654 100644 --- a/tests/integration/Installer/InstallerTest.php +++ b/tests/integration/Installer/InstallerTest.php @@ -32,8 +32,23 @@ final class InstallerTest extends TestCase public static function setUpBeforeClass() { - define('TESTING_QA_TOOLS_INSTALLER', true); - define('QA_TOOLS_INSTALLER_ANSI', false); + if (!defined('TESTING_QA_TOOLS_INSTALLER')) { + define('TESTING_QA_TOOLS_INSTALLER', true); + } elseif (!TESTING_QA_TOOLS_INSTALLER) { + self::fail( + 'Cannot execute Installer unit tests; ' . + "TESTING_QA_TOOLS_INSTALLER constant already defined and is false, rather than true" + ); + } + + if (!defined('QA_TOOLS_INSTALLER_ANSI')) { + define('QA_TOOLS_INSTALLER_ANSI', false); + } elseif (QA_TOOLS_INSTALLER_ANSI) { + self::fail( + 'Cannot execute Installer unit tests; ' . + "QA_TOOLS_INSTALLER_ANSI constant already defined and is true, rather than false" + ); + } require_once __DIR__.'/../../../installer.php'; } diff --git a/tests/system/SystemTest.php b/tests/system/SystemTest.php index 19975ad..977b224 100644 --- a/tests/system/SystemTest.php +++ b/tests/system/SystemTest.php @@ -6,6 +6,9 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Process\ProcessBuilder; +/** + * @group system + */ final class SystemTest extends TestCase { /** diff --git a/tests/unit/Installer/InstallerTest.php b/tests/unit/Installer/InstallerTest.php index 6ba7cce..2958d98 100644 --- a/tests/unit/Installer/InstallerTest.php +++ b/tests/unit/Installer/InstallerTest.php @@ -10,11 +10,6 @@ use PHPUnit\Framework\TestCase; use RuntimeException; -define('TESTING_QA_TOOLS_INSTALLER', true); -define('QA_TOOLS_INSTALLER_ANSI', false); - -require __DIR__.'/../../../installer.php'; - final class InstallerTest extends TestCase { const REPOSITORY_OWNER = 'ibuildingsnl'; @@ -28,6 +23,29 @@ final class InstallerTest extends TestCase /** @var Mockery\Mock|PharValidator */ private $pharValidator; + public static function setUpBeforeClass() + { + if (!defined('TESTING_QA_TOOLS_INSTALLER')) { + define('TESTING_QA_TOOLS_INSTALLER', true); + } elseif (!TESTING_QA_TOOLS_INSTALLER) { + self::fail( + 'Cannot execute Installer unit tests; ' . + "TESTING_QA_TOOLS_INSTALLER constant already defined and is false, rather than true" + ); + } + + if (!defined('QA_TOOLS_INSTALLER_ANSI')) { + define('QA_TOOLS_INSTALLER_ANSI', false); + } elseif (QA_TOOLS_INSTALLER_ANSI) { + self::fail( + 'Cannot execute Installer unit tests; ' . + "QA_TOOLS_INSTALLER_ANSI constant already defined and is true, rather than false" + ); + } + + require_once __DIR__.'/../../../installer.php'; + } + public function setUp() { $this->pharValidator = Mockery::mock(PharValidator::class);