File: phpunit

package info (click to toggle)
php-horde-db 2.4.1-8.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: php: 9,205; xml: 1,007; sql: 22; sh: 16; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

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

if dpkg-architecture -e armel; then
    echo "mysql is absent on armel"
else
    mysql -e "create database IF NOT EXISTS test; ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'r00t';" -uroot
fi

su postgres --command "psql -c \"CREATE USER test WITH PASSWORD 'test';\""
su postgres --command "psql -c \"CREATE DATABASE test OWNER test;\""

cd Horde_Db*/test/./Horde/Db

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