language: php

php:
  - 5.6
  - 7.0
  - 7.1

sudo: false

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

before_install:
 - nvm install node
 - nvm use node

install:
  - cd ../..
  - git clone --depth 1 https://github.com/omeka/omeka-s.git
  - cp -a $(readlink -e $(cd -)) omeka-s/modules/UniversalViewer
  - cd omeka-s
  - npm install
  - ./node_modules/gulp/bin/gulp.js init

before_script:
  - mysql -e "create database IF NOT EXISTS omeka_test;" -uroot
  - sed -i 's/^host.*/host = "localhost"/' application/test/config/database.ini
  - sed -i 's/^user.*/user = "root"/' application/test/config/database.ini
  - sed -i 's/^dbname.*/dbname = "omeka_test"/' application/test/config/database.ini
  - cd modules/UniversalViewer
  - composer install
  - cd test

script: phpunit
