language: php

php:
  - 7.1
services:
  - mysql

before_script:
  - composer self-update
  - composer update
  - mysql -e 'create database cargo_sample;'
  - cp ./config/autoload/local.php.dist ./config/autoload/local.php
  - cp ./config/behat.yml.travis ./config/behat.yml
  - chmod -R 777 ./data/cache
  - php ./bin/migrations.php migrations:migrate -n
  - "sh -e /etc/init.d/xvfb start"
  - "export DISPLAY=:99.0"
  - "java -jar selenium-server-standalone-2.46.0.jar > /dev/null &"
  # webserver setup
  -  php -S localhost:8000 -t public &
  - sleep 10


script:
  - php ./bin/kawaii gherkin:check features/
  - php ./bin/phpunit -c ./CargoBackend/tests
  - php ./bin/phpunit -c ./GraphTraversalBackend/tests
  - bin/behat --verbose


language: php

php:
  - 7.1
services:
  - mysql

before_script:
  - composer self-update
  - composer update
  - mysql -e 'create database cargo_sample;'
  - cp ./config/autoload/local.php.dist ./config/autoload/local.php
  - cp ./config/behat.yml.travis ./config/behat.yml
  - chmod -R 777 ./data/cache
  - php ./bin/migrations.php migrations:migrate -n
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 3
  - "java -jar selenium-server-standalone-2.46.0.jar > /dev/null &"
  # webserver setup
  -  php -S localhost:8000 -t public &
  - sleep 10


script:
  - php ./bin/kawaii gherkin:check features/
  - php ./bin/phpunit -c ./CargoBackend/tests
  - php ./bin/phpunit -c ./GraphTraversalBackend/tests
  - bin/behat --verbose


Add sleep and set env var before starting xvfb
Add sleep and set env var before starting xvfb
