language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6

env:
  - DB=mysql
  - DB=pgsql POSTGRESQL_VERSION=9.1
  - DB=pgsql POSTGRESQL_VERSION=9.2
  - DB=pgsql POSTGRESQL_VERSION=9.3

before_script:
  - sh -c "if [ '$DB' = 'pgsql' ]; then sudo /etc/init.d/postgresql stop; sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION; fi"
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_extensions_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_extensions_tests;' -U postgres; fi"
  - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS doctrine_extensions_tests;'; fi"
  - composer self-update
  - composer update --dev
  - vendor/bin/phpunit --configuration tests/config/$DB.phpunit.xml tests/Oro/Tests/Connection/SetupTest.php

after_success:
  - vendor/bin/phpunit --configuration tests/config/$DB.phpunit.xml tests/Oro/Tests/Connection/TearDownTest.php

script: vendor/bin/phpunit --configuration tests/config/$DB.phpunit.xml --testsuite="Oro Doctrine Extensions Test Suite"
