language: php

services:
  - redis-server
  - rabbitmq

sudo: false

cache:
  directories:
    - $HOME/.composer/cache

php:
  - 5.3
  - 5.3.3
  - 5.4
  - 5.5
  - 5.6

before_install:
  - composer self-update
  - phpenv config-rm xdebug.ini
  - if [[ "$TRAVIS_PHP_VERSION" != "5.3" && "$TRAVIS_PHP_VERSION" != "5.3.3" ]]; then composer require --no-update guzzlehttp/guzzle:~4; fi
  - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then composer require --no-update fabpot/php-cs-fixer:1.9.*; fi

install: composer update $COMPOSER_FLAGS --prefer-dist

script:
  - ./vendor/bin/phpunit -c ./tests/ --coverage-text
  - if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then ./vendor/bin/php-cs-fixer fix -v --dry-run --level=psr2 .; fi

notifications:
  irc: "irc.freenode.org#zftalk.dev"
  email: false
