File: phpunit

package info (click to toggle)
php-horde-cache 2.5.5-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 356 kB
  • sloc: php: 1,678; xml: 735; sh: 14; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e

export CACHE_SQL_MYSQL_TEST_CONFIG='{"cache":{"sql":{"mysql":{"host":"localhost","username":"root","password":"r00t","dbname":"test","charset":"utf-8"}}}}'
export CACHE_SQL_MYSQLI_TEST_CONFIG='{"cache":{"sql":{"mysqli":{"host":"localhost","username":"root","password":"r00t","dbname":"test","charset":"utf-8"}}}}'
export CACHE_SQL_PDO_MYSQL_TEST_CONFIG='{"cache":{"sql":{"pdo_mysql":{"host":"localhost","username":"root","password":"r00t","dbname":"test","charset":"utf-8"}}}}'
export CACHE_SQL_PDO_PGSQL_TEST_CONFIG='{"cache":{"sql":{"pdo_pgsql":{"host":"localhost","username":"test","password":"test","dbname":"test","charset":"utf-8"}}}}'
export CACHE_MEMCACHE_TEST_CONFIG='{"cache": {"memcache": {"hostspec":["localhost"],"port":[11211]}}}'

mysql -e "create database IF NOT EXISTS test; ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'r00t';" -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_Cache*/test/./Horde/Cache

# 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 .'