language: php
sudo: false
php:
  - 7
  - 5.6
  - 5.5
  - 5.4
addons:
  apt:
    packages:
    - ldap-utils
    - slapd
before_script:
  - phpenv config-add tests/travis/enable-ldap.ini
  - pear upgrade pear-1.10.1
  - cat tests/ldapconfig.ini.dist | sed s/389/3389/ > tests/ldapconfig.ini
  - mkdir /tmp/slapd
  - slapd -f tests/ldif_data/slapd.conf -h ldap://localhost:3389 &
  - sleep 3
  - ldapadd -h localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/base.ldif
  - ldapadd -h localhost:3389 -D cn=admin,dc=example,dc=com -w test -f tests/ldif_data/INITIAL_TESTDATA.ldif

script:
  - cd tests
  - phpunit .
