language: php

php:
  - 5.3
  - 5.4
  - 5.5

env:
  - DB=mysql DB_USER=root

before_script:
  # MySQL
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'; fi"
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'; fi"

  # Composer
  - wget http://getcomposer.org/composer.phar
  - php composer.phar install --prefer-source

  - ./test/reset_tests.sh

script: phpunit

language: php

branches:
  only:
    - 1.6
    - master
    - gh-pages

php:
  - 5.3
  - 5.4
  - 5.5

env:
  - DB=mysql DB_USER=root

before_script:
  # MySQL
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'; fi"
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'; fi"

  # Composer
  - wget http://getcomposer.org/composer.phar
  - php composer.phar install --prefer-source

  - ./test/reset_tests.sh

script: phpunit

Allow gh-pages to be tested
Allow gh-pages to be tested
