diff --git a/.gitignore b/.gitignore index 5190c55..64c2ad3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.swp +composer.lock phpunit.xml +vendor/ + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c5a3297 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: php +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - hhvm + +env: COVERAGE=0 + +matrix: + include: + - php: 5.6 + env: COVERAGE=1 + +before_script: + - if [[ "$COVERAGE" -eq 0 ]]; then composer install; else composer require satooshi/php-coveralls --dev; fi + +script: + - if [[ "$COVERAGE" -eq 0 ]]; then vendor/bin/phpunit; else mkdir -p build/logs; vendor/bin/phpunit --coverage-clover=build/logs/clover.xml; fi + +after_success: + - if [[ "$COVERAGE" -gt 0 ]]; then vendor/bin/coveralls; fi diff --git a/README.md b/README.md index 8080bd0..48e85d5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ sailthru-php5-client ==================== +[![Build Status](https://travis-ci.org/sailthru/sailthru-php5-client.svg?branch=master)](https://travis-ci.org/sailthru/sailthru-php5-client) +[![Coverage Status](https://coveralls.io/repos/github/sailthru/sailthru-php5-client/badge.svg?branch=master)](https://coveralls.io/github/sailthru/sailthru-php5-client?branch=master) + For installation instructions, documentation, and examples please visit: [http://getstarted.sailthru.com/new-for-developers-overview/api-client-library/php5](http://getstarted.sailthru.com/new-for-developers-overview/api-client-library/php5) @@ -37,4 +40,14 @@ if ($rate_limit_info) { sleep($seconds_till_reset); } } -``` \ No newline at end of file +``` + +## Tests + +You can run the tests locally with: + +```shell +vendor/bin/phpunit +``` + + diff --git a/composer.json b/composer.json index 9b2a34c..2d425ff 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,9 @@ "description": "Sailthru PHP5 Client", "homepage": "http://github.com/sailthru/sailthru-php5-client", "license": "MIT", + "require-dev": { + "phpunit/phpunit": "~4.8" + }, "autoload": { "classmap": ["sailthru/"] } diff --git a/run_tests.sh b/run_tests.sh deleted file mode 100755 index d3a159b..0000000 --- a/run_tests.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -#Run all test classes -phpunit --configuration phpunit.xml.dist