diff --git a/.travis.yml b/.travis.yml index 41d70ca..1d370a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,4 +66,16 @@ script: else composer check-security; fi; - - composer run-tests \ No newline at end of file + - if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then + echo "Tests with reporting in Clover format are skipped for older PHP versions"; + composer run-tests; + else + composer run-tests-with-clover; + fi; + +after_script: + - if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then + echo "Coveralls report is skipped for older PHP versions"; + else + bin/php-coveralls -v; + fi; diff --git a/README.md b/README.md index 1584228..c95bfa8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/martin-georgiev/social-post/badges/quality-score.png)](https://scrutinizer-ci.com/g/martin-georgiev/social-post/?branch=master) [![Build Status](https://api.travis-ci.org/martin-georgiev/social-post.svg?branch=master)](https://www.travis-ci.org/martin-georgiev/social-post) +[![Coverage Status](https://coveralls.io/repos/github/martin-georgiev/social-post/badge.svg?branch=master)](https://coveralls.io/github/martin-georgiev/social-post?branch=master) [![Latest Stable Version](https://poser.pugx.org/martin-georgiev/social-post/version)](https://packagist.org/packages/martin-georgiev/social-post) [![Total Downloads](https://poser.pugx.org/martin-georgiev/social-post/downloads)](https://packagist.org/packages/martin-georgiev/social-post) @@ -12,7 +13,7 @@ This is a library that provides centralised gateway for publishing post updates ## How to install it? Recommended way is through [Composer](https://getcomposer.org/download/) - composer require "martin-georgiev/social-post" + composer require martin-georgiev/social-post ---- diff --git a/composer.json b/composer.json index 07f9318..5c62a8d 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,7 @@ "jakub-onderka/php-parallel-lint": "^1.0", "phpstan/phpstan": "^0.10.2", "phpunit/phpunit": "^7.2", + "satooshi/php-coveralls": "^2.0", "sensiolabs/security-checker": "^4.1", "symfony/phpunit-bridge": "^3.0|^4.0" }, @@ -61,6 +62,9 @@ "run-tests": [ "bin/phpunit" ], + "run-tests-with-clover": [ + "bin/phpunit --coverage-clover build/logs/clover.xml" + ], "validate-files": [ "bin/parallel-lint --exclude vendor --exclude bin ." ] diff --git a/phpunit.xml b/phpunit.xml index a9a56ec..ff34496 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,37 +1,24 @@ - + colors="true" + convertErrorsToExceptions="true" + convertNoticesToExceptions="false" + convertWarningsToExceptions="true" + stopOnFailure="false" + bootstrap="vendor/autoload.php" + verbose="true" + syntaxCheck="true"> + - - tests/ + + ./tests - - - - - - + - - src/ + + ./src - - - - - - + + \ No newline at end of file