Improve Travis setup
[m6w6/ext-pq] / travis / configure-postgres.sh
index de5355c..09a41e2 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh -x
 
-psql -c 'create database pq_test;' -U postgres
-echo '<?php const PQ_DSN = "postgres://postgres@localhost/pq_test";' > ./tests/_setup.inc
+PQ_CREATE_DB_SQL="CREATE DATABASE $PG_TEST_DB_NAME;"
+PQ_DSN="postgres://$PG_TEST_DB_USER@localhost/$PG_TEST_DB_NAME"
+
+psql -c "$PQ_CREATE_DB_SQL" -U $PG_TEST_DB_USER
+echo "<?php const PQ_DSN = '$PQ_DSN';" > ./tests/_setup.inc