diff --git a/composer.json b/composer.json index 365123ff0..8738048ca 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,9 @@ "doctrine/cache": "^1.6" }, "require-dev": { - "phpunit/phpunit": "^4.8" + "phpunit/phpunit": "4.8.*", + "squizlabs/php_codesniffer": "2.5.*", + "sebastian/phpcpd": "2.0.*" }, "autoload": { "psr-4": { @@ -54,5 +56,24 @@ } }, "minimum-stability": "stable", - "prefer-stable": true + "prefer-stable": true, + "scripts": { + "test": [ + "composer test:lint", + "composer test:unit", + "composer test:cpd" + ], + "test:lint": [ + "vendor/bin/phpcs --colors --report-full --standard=PSR2 src tests" + ], + "test:unit": [ + "vendor/bin/phpunit --configuration phpunit.xml --coverage-text" + ], + "test:unit:html": [ + "vendor/bin/phpunit --configuration phpunit.xml --coverage-html=internal_data/report" + ], + "test:cpd": [ + "vendor/bin/phpcpd --exclude=vendor --exclude=internal_data ." + ] + } } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 000000000..835767d8e --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,16 @@ + + + + Codestyle ruleset for TorrentPier + + + + src + + + + + tests/* + vendor/* + +