language: php

sudo: false

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - 7
  - hhvm

env:
  global:
    - DISPLAY=:99.0

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

before_install:
  - composer self-update

install:
  - composer install --no-interaction --prefer-source

before_script:
  - sh -e /etc/init.d/xvfb start
  - wget -q -t 3 http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar
  - java -jar selenium-server-standalone-2.45.0.jar -log selenium.log &
  - until $(echo | nc localhost 4444); do sleep 1; echo waiting for selenium-server...; done;

script: ./vendor/bin/phpunit

after_script:
  - cat selenium.log
