File: phpunit

package info (click to toggle)
php-horde-db 2.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 884 kB
  • ctags: 2,259
  • sloc: php: 8,675; xml: 804; sql: 22; sh: 11; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

export DB_ADAPTER_MYSQL_TEST_CONFIG='{"db":{"adapter":{"mysql":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}'
export DB_ADAPTER_MYSQLI_TEST_CONFIG='{"db":{"adapter":{"mysqli":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}'
export DB_ADAPTER_PDO_MYSQL_TEST_CONFIG='{"db":{"adapter":{"pdo":{"mysql":{"test":{"host":"localhost","username":"root","password":"","dbname":"test"}}}}}}'
export DB_ADAPTER_PDO_PGSQL_TEST_CONFIG='{"db":{"adapter":{"pdo":{"pgsql":{"test":{"host":"localhost","username":"test","password":"test","dbname":"test"}}}}}}'

mysql -e 'create database IF NOT EXISTS test;' -uroot
su postgres --command 'createdb test'
su postgres --command "psql -c \"CREATE USER test WITH PASSWORD 'test';\""
su postgres --command "psql -c \"GRANT ALL ON DATABASE test TO test;\""

cd Horde_Db*/test/./Horde/Db
# We drop privileges to run tests
su www-data --preserve-environment --shell /bin/sh --command 'phpunit -v .'