language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhvm

env:
  - DB=mysql
  - DB=pgsql
  - DB=sqlite

matrix:
  allow_failures:
    - env: DB=pgsql
  exclude:
    - php: hhvm
      env: DB=pgsql # driver currently unsupported by HHVM

before_script:
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS acl_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE acl_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS acl_tests;'; fi"
  - composer require satooshi/php-coveralls:dev-master --dev --no-interaction --prefer-source

script:
  - mkdir -p build/logs
  - phpunit --configuration tests/travis/$DB.phpunit.xml --coverage-clover build/logs/clover.xml

after_script:
  - php vendor/bin/coveralls -v

language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhvm

env:
  - DB=mysql
  - DB=pgsql
  - DB=sqlite

matrix:
  allow_failures:
    - env: DB=pgsql
    - php: hhvm
  exclude:
    - php: hhvm
      env: DB=pgsql # driver currently unsupported by HHVM

before_script:
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS acl_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE acl_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS acl_tests;'; fi"
  - composer require satooshi/php-coveralls:dev-master --dev --no-interaction --prefer-source

script:
  - mkdir -p build/logs
  - phpunit --configuration tests/travis/$DB.phpunit.xml --coverage-clover build/logs/clover.xml

after_script:
  - php vendor/bin/coveralls -v

Allow failures for HHVM because Travis is on old HHVM
Allow failures for HHVM because Travis is on old HHVM
