Skip to content

Commit

Permalink
Merge pull request #65 from rossmotley/php-unit-stuff
Browse files Browse the repository at this point in the history
Making PhpUnit a composer dependency; adding Travis CI and Coveralls integration.
  • Loading branch information
silverman63 authored Jan 27, 2017
2 parents 27d371e + 2c906b6 commit e568bcc
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.swp
composer.lock
phpunit.xml
vendor/

24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -37,4 +40,14 @@ if ($rate_limit_info) {
sleep($seconds_till_reset);
}
}
```
```

## Tests

You can run the tests locally with:

```shell
vendor/bin/phpunit
```


3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]
}
Expand Down
4 changes: 0 additions & 4 deletions run_tests.sh

This file was deleted.

0 comments on commit e568bcc

Please sign in to comment.