#!/bin/sh

set -e

# We need to be root here ...
for locale in 'en_US.UTF-8 UTF-8'; do
  sed -i -e "0,/^[# ]*$locale *$/ s/^[# ]*$locale *$/$locale/" /etc/locale.gen
done
locale-gen

cd Horde_Core*/test/./Horde/Core

# but we drop privileges to run the tests...
touch .phpunit.result.cache
chown www-data:www-data .phpunit.result.cache
su www-data --preserve-environment --shell /bin/sh --command 'phpunit -v .'
