language: php

php:
  - 5.4
services:
  - mysql

before_script:
  - composer self-update
  - composer update
  - mysql -e 'create database cargo_sample;'
  - mysql -uroot cargo_sample < ./scripts/cargo_sample.sql
  - cp ./config/autoload/local.php.dist ./config/autoload/local.php
  - cp ./config/behat.yml.travis ./config/behat.yml
  - chmod -R 777 ./data/cache
  - "sh -e /etc/init.d/xvfb start"
  - "export DISPLAY=:99.0"
  - "wget http://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar"
  - "java -jar selenium-server-standalone-2.31.0.jar > /dev/null &"
  # webserver setup
  -  php -S localhost:8000 -t public/ &
  - sleep 5


script:
  - php ./bin/phpunit -c ./module/Application/tests/PHPUnit
  - bin/behat --verbose


language: php

php:
  - 5.4
services:
  - mysql

before_script:
  - composer self-update
  - composer update
  - mysql -e 'create database cargo_sample;'
  - mysql -uroot cargo_sample < ./scripts/cargo_sample.sql
  - cp ./config/autoload/local.php.dist ./config/autoload/local.php
  - cp ./config/behat.yml.travis ./config/behat.yml
  - chmod -R 777 ./data/cache
  - "sh -e /etc/init.d/xvfb start"
  - "export DISPLAY=:99.0"
  - "wget http://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar"
  - "java -jar selenium-server-standalone-2.31.0.jar > /dev/null &"
  # webserver setup
  -  php -S localhost:8000 -t public/ &
  - sleep 10


script:
  - php ./bin/phpunit -c ./module/Application/tests/PHPUnit
  - bin/behat --verbose


Increase sleep time to avoid build errors
Increase sleep time to avoid build errors
